diff options
author | 2024-02-28 10:28:12 +0100 | |
---|---|---|
committer | 2024-02-28 10:28:12 +0100 | |
commit | a37ae8a99b9edb363eb084e17eec35f3c4761313 (patch) | |
tree | 06b2db1fd7565b9d615c2e79ba022e3cc7c3f690 /Sources/WireGuardApp/UI/iOS | |
parent | Remove backward compatibility of GetPeers with SiriKit version (diff) | |
parent | App: version bump (diff) | |
download | wireguard-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')
25 files changed, 48 insertions, 137 deletions
diff --git a/Sources/WireGuardApp/UI/iOS/AppDelegate.swift b/Sources/WireGuardApp/UI/iOS/AppDelegate.swift index 9be1ba1..7623b7e 100644 --- a/Sources/WireGuardApp/UI/iOS/AppDelegate.swift +++ b/Sources/WireGuardApp/UI/iOS/AppDelegate.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 import os.log diff --git a/Sources/WireGuardApp/UI/iOS/ConfirmationAlertPresenter.swift b/Sources/WireGuardApp/UI/iOS/ConfirmationAlertPresenter.swift index 824a0a5..add648b 100644 --- a/Sources/WireGuardApp/UI/iOS/ConfirmationAlertPresenter.swift +++ b/Sources/WireGuardApp/UI/iOS/ConfirmationAlertPresenter.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 diff --git a/Sources/WireGuardApp/UI/iOS/ErrorPresenter.swift b/Sources/WireGuardApp/UI/iOS/ErrorPresenter.swift index 5dd505b..6961ac1 100644 --- a/Sources/WireGuardApp/UI/iOS/ErrorPresenter.swift +++ b/Sources/WireGuardApp/UI/iOS/ErrorPresenter.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 import os.log diff --git a/Sources/WireGuardApp/UI/iOS/QuickActionItem.swift b/Sources/WireGuardApp/UI/iOS/QuickActionItem.swift index f41d8a0..587e31f 100644 --- a/Sources/WireGuardApp/UI/iOS/QuickActionItem.swift +++ b/Sources/WireGuardApp/UI/iOS/QuickActionItem.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 diff --git a/Sources/WireGuardApp/UI/iOS/RecentTunnelsTracker.swift b/Sources/WireGuardApp/UI/iOS/RecentTunnelsTracker.swift index ddc5ca9..f9bf813 100644 --- a/Sources/WireGuardApp/UI/iOS/RecentTunnelsTracker.swift +++ b/Sources/WireGuardApp/UI/iOS/RecentTunnelsTracker.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 Foundation diff --git a/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift b/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift index dc981d2..217a3ca 100644 --- a/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift +++ b/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.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 diff --git a/Sources/WireGuardApp/UI/iOS/View/BorderedTextButton.swift b/Sources/WireGuardApp/UI/iOS/View/BorderedTextButton.swift index f8f373a..6f9d55c 100644 --- a/Sources/WireGuardApp/UI/iOS/View/BorderedTextButton.swift +++ b/Sources/WireGuardApp/UI/iOS/View/BorderedTextButton.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 diff --git a/Sources/WireGuardApp/UI/iOS/View/ButtonCell.swift b/Sources/WireGuardApp/UI/iOS/View/ButtonCell.swift index 1d9912d..ae7a144 100644 --- a/Sources/WireGuardApp/UI/iOS/View/ButtonCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/ButtonCell.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 diff --git a/Sources/WireGuardApp/UI/iOS/View/CheckmarkCell.swift b/Sources/WireGuardApp/UI/iOS/View/CheckmarkCell.swift index 34eb0df..fedef53 100644 --- a/Sources/WireGuardApp/UI/iOS/View/CheckmarkCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/CheckmarkCell.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 diff --git a/Sources/WireGuardApp/UI/iOS/View/ChevronCell.swift b/Sources/WireGuardApp/UI/iOS/View/ChevronCell.swift index 30256a0..0429fb9 100644 --- a/Sources/WireGuardApp/UI/iOS/View/ChevronCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/ChevronCell.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 diff --git a/Sources/WireGuardApp/UI/iOS/View/EditableTextCell.swift b/Sources/WireGuardApp/UI/iOS/View/EditableTextCell.swift index d84d23e..e065b4f 100644 --- a/Sources/WireGuardApp/UI/iOS/View/EditableTextCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/EditableTextCell.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 diff --git a/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift b/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift index e8c3850..ab1a71f 100644 --- a/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/KeyValueCell.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 @@ -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..4bedbba 100644 --- a/Sources/WireGuardApp/UI/iOS/View/SwitchCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/SwitchCell.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 @@ -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..3024b46 100644 --- a/Sources/WireGuardApp/UI/iOS/View/TextCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/TextCell.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 @@ -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..d151402 100644 --- a/Sources/WireGuardApp/UI/iOS/View/TunnelEditKeyValueCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/TunnelEditKeyValueCell.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 @@ -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..71ee6d8 100644 --- a/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.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 @@ -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 }() 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) diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/MainViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/MainViewController.swift index 6aab559..39780f1 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/MainViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/MainViewController.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 @@ -13,11 +13,7 @@ class MainViewController: UISplitViewController { init() { let detailVC = UIViewController() - if #available(iOS 13.0, *) { - detailVC.view.backgroundColor = .systemBackground - } else { - detailVC.view.backgroundColor = .white - } + detailVC.view.backgroundColor = .systemBackground let detailNC = UINavigationController(rootViewController: detailVC) let masterVC = TunnelsListTableViewController() diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.swift index 4be0d67..cb297a6 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.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 AVFoundation import UIKit diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionDetailTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionDetailTableViewController.swift index d315e2f..4211560 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionDetailTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionDetailTableViewController.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 diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift index d32fa8c..ef9a88c 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.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 import SystemConfiguration.CaptiveNetwork @@ -185,11 +185,7 @@ extension SSIDOptionEditTableViewController { private func noSSIDsCell(for tableView: UITableView, at indexPath: IndexPath) -> UITableViewCell { let cell: TextCell = tableView.dequeueReusableCell(for: indexPath) cell.message = tr("tunnelOnDemandNoSSIDs") - if #available(iOS 13.0, *) { - cell.setTextColor(.secondaryLabel) - } else { - cell.setTextColor(.gray) - } + cell.setTextColor(.secondaryLabel) cell.setTextAlignment(.center) return cell } @@ -268,23 +264,8 @@ extension SSIDOptionEditTableViewController { #if targetEnvironment(simulator) completionHandler("Simulator Wi-Fi") #else - if #available(iOS 14, *) { - NEHotspotNetwork.fetchCurrent { hotspotNetwork in - completionHandler(hotspotNetwork?.ssid) - } - } else { - if let supportedInterfaces = CNCopySupportedInterfaces() as? [CFString] { - for interface in supportedInterfaces { - if let networkInfo = CNCopyCurrentNetworkInfo(interface) { - if let ssid = (networkInfo as NSDictionary)[kCNNetworkInfoKeySSID as String] as? String { - completionHandler(!ssid.isEmpty ? ssid : nil) - return - } - } - } - } - - completionHandler(nil) + NEHotspotNetwork.fetchCurrent { hotspotNetwork in + completionHandler(hotspotNetwork?.ssid) } #endif } diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift index afec4b0..483b779 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.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 import os.log diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift index 196de0c..509d123 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.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 diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift index e44cf8d..dfb35c6 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.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 diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.swift index 85e64ce..4486151 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.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 import MobileCoreServices @@ -33,11 +33,7 @@ class TunnelsListTableViewController: UIViewController { 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 }() @@ -51,11 +47,7 @@ class TunnelsListTableViewController: UIViewController { override func loadView() { view = UIView() - if #available(iOS 13.0, *) { - view.backgroundColor = .systemBackground - } else { - view.backgroundColor = .white - } + view.backgroundColor = .systemBackground tableView.dataSource = self tableView.delegate = self @@ -406,11 +398,7 @@ extension TunnelsListTableViewController: TunnelsManagerListDelegate { (splitViewController.viewControllers[0] as? UINavigationController)?.popToRootViewController(animated: false) } else { let detailVC = UIViewController() - if #available(iOS 13.0, *) { - detailVC.view.backgroundColor = .systemBackground - } else { - detailVC.view.backgroundColor = .white - } + detailVC.view.backgroundColor = .systemBackground let detailNC = UINavigationController(rootViewController: detailVC) splitViewController.showDetailViewController(detailNC, sender: self) } |