aboutsummaryrefslogtreecommitdiffstats
path: root/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift')
-rw-r--r--Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift27
1 files changed, 4 insertions, 23 deletions
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
}