aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-11-05 06:31:25 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-11-05 06:31:25 +0100
commite228ac9d9902efc58a0d3c8756b43d9435f3f90f (patch)
treed41ac79ccf93c00bee8664b01dc4bd82996a1d8a
parentTunnelsManager: account for no or many endpoints (diff)
downloadwireguard-apple-e228ac9d9902efc58a0d3c8756b43d9435f3f90f.tar.xz
wireguard-apple-e228ac9d9902efc58a0d3c8756b43d9435f3f90f.zip
global: convert to Swift 4.2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--WireGuard/WireGuard.xcodeproj/project.pbxproj2
-rw-r--r--WireGuard/WireGuard/UI/iOS/AppDelegate.swift4
-rw-r--r--WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift2
-rw-r--r--WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift4
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift6
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift6
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift6
7 files changed, 16 insertions, 14 deletions
diff --git a/WireGuard/WireGuard.xcodeproj/project.pbxproj b/WireGuard/WireGuard.xcodeproj/project.pbxproj
index 69a1383..9ff9e77 100644
--- a/WireGuard/WireGuard.xcodeproj/project.pbxproj
+++ b/WireGuard/WireGuard.xcodeproj/project.pbxproj
@@ -751,6 +751,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h";
+ SWIFT_VERSION = 4.2;
};
name = Debug;
};
@@ -770,6 +771,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h";
+ SWIFT_VERSION = 4.2;
};
name = Release;
};
diff --git a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
index d7d1652..4e09650 100644
--- a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
@@ -11,7 +11,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var mainVC: MainViewController?
func application(_ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
window.backgroundColor = UIColor.white
@@ -26,7 +26,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}
- func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any] = [:]) -> Bool {
+ func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
defer {
do {
try FileManager.default.removeItem(at: url)
diff --git a/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift b/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
index ffe8d6f..daddf0a 100644
--- a/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
+++ b/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
@@ -14,7 +14,7 @@ class CopyableLabelTableViewCell: UITableViewCell {
fatalError("init(coder:) has not been implemented")
}
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(_:)))
self.addGestureRecognizer(gestureRecognizer)
diff --git a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
index 6bfad92..de7db2e 100644
--- a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
@@ -172,7 +172,7 @@ class TunnelSettingsTableViewKeyValueCell: UITableViewCell {
set(value) { detailTextLabel?.text = value }
}
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: .value1, reuseIdentifier: TunnelSettingsTableViewKeyValueCell.id)
}
@@ -197,7 +197,7 @@ class TunnelSettingsTableViewButtonCell: UITableViewCell {
let button: UIButton
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
button = UIButton(type: .system)
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.addSubview(button)
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
index 3165553..64aaa7b 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
@@ -227,7 +227,7 @@ class TunnelDetailTableViewStatusCell: UITableViewCell {
let statusSwitch: UISwitch
private var statusObservervationToken: AnyObject?
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
statusSwitch = UISwitch()
super.init(style: .default, reuseIdentifier: TunnelDetailTableViewKeyValueCell.id)
accessoryView = statusSwitch
@@ -308,7 +308,7 @@ class TunnelDetailTableViewKeyValueCell: CopyableLabelTableViewCell {
let valueLabel: UILabel
let valueScroller: UIScrollView
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
keyLabel = UILabel()
valueLabel = UILabel()
valueScroller = UIScrollView()
@@ -387,7 +387,7 @@ class TunnelDetailTableViewButtonCell: UITableViewCell {
let button: UIButton
var buttonStandardTintColor: UIColor
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
button = UIButton(type: .system)
buttonStandardTintColor = button.tintColor
super.init(style: style, reuseIdentifier: reuseIdentifier)
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
index 37613c2..70b40b5 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
@@ -448,7 +448,7 @@ class TunnelEditTableViewKeyValueCell: CopyableLabelTableViewCell {
private var textFieldValueOnBeginEditing: String = ""
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
keyLabel = UILabel()
valueTextField = UITextField()
super.init(style: style, reuseIdentifier: reuseIdentifier)
@@ -539,7 +539,7 @@ class TunnelEditTableViewButtonCell: UITableViewCell {
let button: UIButton
var buttonStandardTintColor: UIColor
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
button = UIButton(type: .system)
buttonStandardTintColor = button.tintColor
super.init(style: style, reuseIdentifier: reuseIdentifier)
@@ -590,7 +590,7 @@ class TunnelEditTableViewSwitchCell: UITableViewCell {
let switchView: UISwitch
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
switchView = UISwitch()
super.init(style: .default, reuseIdentifier: reuseIdentifier)
accessoryView = switchView
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
index 48515e9..7e06bce 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
@@ -25,7 +25,7 @@ class TunnelsListTableViewController: UIViewController {
self.navigationItem.leftBarButtonItem = settingsButtonItem
// Set up the busy indicator
- let busyIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
+ let busyIndicator = UIActivityIndicatorView(style: .gray)
busyIndicator.hidesWhenStopped = true
// Add the busyIndicator, centered
@@ -386,9 +386,9 @@ class TunnelsListTableViewCell: UITableViewCell {
private var statusObservervationToken: AnyObject?
private var nameObservervationToken: AnyObject?
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
nameLabel = UILabel()
- busyIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
+ busyIndicator = UIActivityIndicatorView(style: .gray)
busyIndicator.hidesWhenStopped = true
statusSwitch = UISwitch()
super.init(style: style, reuseIdentifier: reuseIdentifier)