aboutsummaryrefslogtreecommitdiffstats
path: root/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
diff options
context:
space:
mode:
authorAlessio Nossa <alessio.nossa@gmail.com>2024-02-28 10:28:12 +0100
committerAlessio Nossa <alessio.nossa@gmail.com>2024-02-28 10:28:12 +0100
commita37ae8a99b9edb363eb084e17eec35f3c4761313 (patch)
tree06b2db1fd7565b9d615c2e79ba022e3cc7c3f690 /Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
parentRemove backward compatibility of GetPeers with SiriKit version (diff)
parentApp: version bump (diff)
downloadwireguard-apple-an/shortcuts-integration.tar.xz
wireguard-apple-an/shortcuts-integration.zip
Merge branch 'master' into an/shortcuts-integrationan/shortcuts-integration
Diffstat (limited to 'Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift')
-rw-r--r--Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift32
1 files changed, 7 insertions, 25 deletions
diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
index eed5e46..2398919 100644
--- a/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
+++ b/Sources/WireGuardApp/UI/iOS/ViewController/LogViewController.swift
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
-// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
+// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
import UIKit
@@ -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)