aboutsummaryrefslogtreecommitdiffstats
path: root/Sources/WireGuardApp/UI/iOS/View
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-02-14 15:31:52 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2023-02-15 14:20:30 +0100
commit901fe1cf58dc40e551088cac3bf00d68e3e86db3 (patch)
tree25750069c190aa121b12b4fc9d980efeaba5e191 /Sources/WireGuardApp/UI/iOS/View
parentWireGuardKitGo: bump (diff)
downloadwireguard-apple-901fe1cf58dc40e551088cac3bf00d68e3e86db3.tar.xz
wireguard-apple-901fe1cf58dc40e551088cac3bf00d68e3e86db3.zip
App: bump minimum OS versions
This allows us to remove a good deal of legacy cruft. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'Sources/WireGuardApp/UI/iOS/View')
-rw-r--r--Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift26
-rw-r--r--Sources/WireGuardApp/UI/iOS/View/SwitchCell.swift6
-rw-r--r--Sources/WireGuardApp/UI/iOS/View/TextCell.swift6
-rw-r--r--Sources/WireGuardApp/UI/iOS/View/TunnelEditKeyValueCell.swift6
-rw-r--r--Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift12
5 files changed, 10 insertions, 46 deletions
diff --git a/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift b/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift
index e8c3850..3162abf 100644
--- a/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift
+++ b/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift
@@ -9,11 +9,7 @@ class KeyValueCell: UITableViewCell {
let keyLabel = UILabel()
keyLabel.font = UIFont.preferredFont(forTextStyle: .body)
keyLabel.adjustsFontForContentSizeCategory = true
- if #available(iOS 13.0, *) {
- keyLabel.textColor = .label
- } else {
- keyLabel.textColor = .black
- }
+ keyLabel.textColor = .label
keyLabel.textAlignment = .left
return keyLabel
}()
@@ -35,11 +31,7 @@ class KeyValueCell: UITableViewCell {
valueTextField.autocapitalizationType = .none
valueTextField.autocorrectionType = .no
valueTextField.spellCheckingType = .no
- if #available(iOS 13.0, *) {
- valueTextField.textColor = .secondaryLabel
- } else {
- valueTextField.textColor = .gray
- }
+ valueTextField.textColor = .secondaryLabel
return valueTextField
}()
@@ -64,18 +56,10 @@ class KeyValueCell: UITableViewCell {
var isValueValid = true {
didSet {
- if #available(iOS 13.0, *) {
- if isValueValid {
- keyLabel.textColor = .label
- } else {
- keyLabel.textColor = .systemRed
- }
+ if isValueValid {
+ keyLabel.textColor = .label
} else {
- if isValueValid {
- keyLabel.textColor = .black
- } else {
- keyLabel.textColor = .red
- }
+ keyLabel.textColor = .systemRed
}
}
}
diff --git a/Sources/WireGuardApp/UI/iOS/View/SwitchCell.swift b/Sources/WireGuardApp/UI/iOS/View/SwitchCell.swift
index 3952ffd..82d3dec 100644
--- a/Sources/WireGuardApp/UI/iOS/View/SwitchCell.swift
+++ b/Sources/WireGuardApp/UI/iOS/View/SwitchCell.swift
@@ -16,11 +16,7 @@ class SwitchCell: UITableViewCell {
get { return switchView.isEnabled }
set(value) {
switchView.isEnabled = value
- if #available(iOS 13.0, *) {
- textLabel?.textColor = value ? .label : .secondaryLabel
- } else {
- textLabel?.textColor = value ? .black : .gray
- }
+ textLabel?.textColor = value ? .label : .secondaryLabel
}
}
diff --git a/Sources/WireGuardApp/UI/iOS/View/TextCell.swift b/Sources/WireGuardApp/UI/iOS/View/TextCell.swift
index 9de5012..5c39512 100644
--- a/Sources/WireGuardApp/UI/iOS/View/TextCell.swift
+++ b/Sources/WireGuardApp/UI/iOS/View/TextCell.swift
@@ -28,11 +28,7 @@ class TextCell: UITableViewCell {
override func prepareForReuse() {
super.prepareForReuse()
message = ""
- if #available(iOS 13.0, *) {
- setTextColor(.label)
- } else {
- setTextColor(.black)
- }
+ setTextColor(.label)
setTextAlignment(.left)
}
}
diff --git a/Sources/WireGuardApp/UI/iOS/View/TunnelEditKeyValueCell.swift b/Sources/WireGuardApp/UI/iOS/View/TunnelEditKeyValueCell.swift
index ac6f063..a44af7c 100644
--- a/Sources/WireGuardApp/UI/iOS/View/TunnelEditKeyValueCell.swift
+++ b/Sources/WireGuardApp/UI/iOS/View/TunnelEditKeyValueCell.swift
@@ -30,11 +30,7 @@ class TunnelEditEditableKeyValueCell: TunnelEditKeyValueCell {
super.init(style: style, reuseIdentifier: reuseIdentifier)
copyableGesture = false
- if #available(iOS 13.0, *) {
- valueTextField.textColor = .label
- } else {
- valueTextField.textColor = .black
- }
+ valueTextField.textColor = .label
valueTextField.isEnabled = true
valueLabelScrollView.isScrollEnabled = false
valueTextField.widthAnchor.constraint(equalTo: valueLabelScrollView.widthAnchor).isActive = true
diff --git a/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift b/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift
index 4dbe97c..97948b8 100644
--- a/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift
+++ b/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift
@@ -41,21 +41,13 @@ class TunnelListCell: UITableViewCell {
label.font = UIFont.preferredFont(forTextStyle: .caption2)
label.adjustsFontForContentSizeCategory = true
label.numberOfLines = 1
- if #available(iOS 13.0, *) {
- label.textColor = .secondaryLabel
- } else {
- label.textColor = .gray
- }
+ label.textColor = .secondaryLabel
return label
}()
let busyIndicator: UIActivityIndicatorView = {
let busyIndicator: UIActivityIndicatorView
- if #available(iOS 13.0, *) {
- busyIndicator = UIActivityIndicatorView(style: .medium)
- } else {
- busyIndicator = UIActivityIndicatorView(style: .gray)
- }
+ busyIndicator = UIActivityIndicatorView(style: .medium)
busyIndicator.hidesWhenStopped = true
return busyIndicator
}()