aboutsummaryrefslogtreecommitdiffstats
path: root/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
diff options
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/ViewController/LogViewController.swift
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/ViewController/LogViewController.swift')
-rw-r--r--Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift30
1 files changed, 6 insertions, 24 deletions
diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
index eed5e46..4e4a131 100644
--- a/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
+++ b/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
@@ -15,15 +15,9 @@ class LogViewController: UIViewController {
}()
let busyIndicator: UIActivityIndicatorView = {
- if #available(iOS 13.0, *) {
- let busyIndicator = UIActivityIndicatorView(style: .medium)
- busyIndicator.hidesWhenStopped = true
- return busyIndicator
- } else {
- let busyIndicator = UIActivityIndicatorView(style: .gray)
- busyIndicator.hidesWhenStopped = true
- return busyIndicator
- }
+ let busyIndicator = UIActivityIndicatorView(style: .medium)
+ busyIndicator.hidesWhenStopped = true
+ return busyIndicator
}()
let paragraphStyle: NSParagraphStyle = {
@@ -41,12 +35,7 @@ class LogViewController: UIViewController {
override func loadView() {
view = UIView()
- if #available(iOS 13.0, *) {
- view.backgroundColor = .systemBackground
- } else {
- view.backgroundColor = .white
- }
-
+ view.backgroundColor = .systemBackground
view.addSubview(textView)
textView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
@@ -92,15 +81,8 @@ class LogViewController: UIViewController {
let bodyFont = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.body)
let captionFont = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.caption1)
for logEntry in fetchedLogEntries {
- var bgColor: UIColor
- var fgColor: UIColor
- if #available(iOS 13.0, *) {
- bgColor = self.isNextLineHighlighted ? .systemGray3 : .systemBackground
- fgColor = .label
- } else {
- bgColor = self.isNextLineHighlighted ? UIColor(white: 0.88, alpha: 1.0) : UIColor.white
- fgColor = .black
- }
+ let bgColor: UIColor = self.isNextLineHighlighted ? .systemGray3 : .systemBackground
+ let fgColor: UIColor = .label
let timestampText = NSAttributedString(string: logEntry.timestamp + "\n", attributes: [.font: captionFont, .backgroundColor: bgColor, .foregroundColor: fgColor, .paragraphStyle: self.paragraphStyle])
let messageText = NSAttributedString(string: logEntry.message + "\n", attributes: [.font: bodyFont, .backgroundColor: bgColor, .foregroundColor: fgColor, .paragraphStyle: self.paragraphStyle])
richText.append(timestampText)