global: convert to Swift 4.2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -751,6 +751,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)";
|
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@@ -770,6 +771,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)";
|
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
var mainVC: MainViewController?
|
var mainVC: MainViewController?
|
||||||
|
|
||||||
func application(_ application: UIApplication,
|
func application(_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
|
|
||||||
let window = UIWindow(frame: UIScreen.main.bounds)
|
let window = UIWindow(frame: UIScreen.main.bounds)
|
||||||
window.backgroundColor = UIColor.white
|
window.backgroundColor = UIColor.white
|
||||||
@@ -26,7 +26,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
return true
|
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 {
|
defer {
|
||||||
do {
|
do {
|
||||||
try FileManager.default.removeItem(at: url)
|
try FileManager.default.removeItem(at: url)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class CopyableLabelTableViewCell: UITableViewCell {
|
|||||||
fatalError("init(coder:) has not been implemented")
|
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)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(_:)))
|
let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(_:)))
|
||||||
self.addGestureRecognizer(gestureRecognizer)
|
self.addGestureRecognizer(gestureRecognizer)
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class TunnelSettingsTableViewKeyValueCell: UITableViewCell {
|
|||||||
set(value) { detailTextLabel?.text = value }
|
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)
|
super.init(style: .value1, reuseIdentifier: TunnelSettingsTableViewKeyValueCell.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ class TunnelSettingsTableViewButtonCell: UITableViewCell {
|
|||||||
|
|
||||||
let button: UIButton
|
let button: UIButton
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
button = UIButton(type: .system)
|
button = UIButton(type: .system)
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
contentView.addSubview(button)
|
contentView.addSubview(button)
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class TunnelDetailTableViewStatusCell: UITableViewCell {
|
|||||||
let statusSwitch: UISwitch
|
let statusSwitch: UISwitch
|
||||||
private var statusObservervationToken: AnyObject?
|
private var statusObservervationToken: AnyObject?
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
statusSwitch = UISwitch()
|
statusSwitch = UISwitch()
|
||||||
super.init(style: .default, reuseIdentifier: TunnelDetailTableViewKeyValueCell.id)
|
super.init(style: .default, reuseIdentifier: TunnelDetailTableViewKeyValueCell.id)
|
||||||
accessoryView = statusSwitch
|
accessoryView = statusSwitch
|
||||||
@@ -308,7 +308,7 @@ class TunnelDetailTableViewKeyValueCell: CopyableLabelTableViewCell {
|
|||||||
let valueLabel: UILabel
|
let valueLabel: UILabel
|
||||||
let valueScroller: UIScrollView
|
let valueScroller: UIScrollView
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
keyLabel = UILabel()
|
keyLabel = UILabel()
|
||||||
valueLabel = UILabel()
|
valueLabel = UILabel()
|
||||||
valueScroller = UIScrollView()
|
valueScroller = UIScrollView()
|
||||||
@@ -387,7 +387,7 @@ class TunnelDetailTableViewButtonCell: UITableViewCell {
|
|||||||
let button: UIButton
|
let button: UIButton
|
||||||
var buttonStandardTintColor: UIColor
|
var buttonStandardTintColor: UIColor
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
button = UIButton(type: .system)
|
button = UIButton(type: .system)
|
||||||
buttonStandardTintColor = button.tintColor
|
buttonStandardTintColor = button.tintColor
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ class TunnelEditTableViewKeyValueCell: CopyableLabelTableViewCell {
|
|||||||
|
|
||||||
private var textFieldValueOnBeginEditing: String = ""
|
private var textFieldValueOnBeginEditing: String = ""
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
keyLabel = UILabel()
|
keyLabel = UILabel()
|
||||||
valueTextField = UITextField()
|
valueTextField = UITextField()
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
@@ -539,7 +539,7 @@ class TunnelEditTableViewButtonCell: UITableViewCell {
|
|||||||
let button: UIButton
|
let button: UIButton
|
||||||
var buttonStandardTintColor: UIColor
|
var buttonStandardTintColor: UIColor
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
button = UIButton(type: .system)
|
button = UIButton(type: .system)
|
||||||
buttonStandardTintColor = button.tintColor
|
buttonStandardTintColor = button.tintColor
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
@@ -590,7 +590,7 @@ class TunnelEditTableViewSwitchCell: UITableViewCell {
|
|||||||
|
|
||||||
let switchView: UISwitch
|
let switchView: UISwitch
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
switchView = UISwitch()
|
switchView = UISwitch()
|
||||||
super.init(style: .default, reuseIdentifier: reuseIdentifier)
|
super.init(style: .default, reuseIdentifier: reuseIdentifier)
|
||||||
accessoryView = switchView
|
accessoryView = switchView
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class TunnelsListTableViewController: UIViewController {
|
|||||||
self.navigationItem.leftBarButtonItem = settingsButtonItem
|
self.navigationItem.leftBarButtonItem = settingsButtonItem
|
||||||
|
|
||||||
// Set up the busy indicator
|
// Set up the busy indicator
|
||||||
let busyIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
|
let busyIndicator = UIActivityIndicatorView(style: .gray)
|
||||||
busyIndicator.hidesWhenStopped = true
|
busyIndicator.hidesWhenStopped = true
|
||||||
|
|
||||||
// Add the busyIndicator, centered
|
// Add the busyIndicator, centered
|
||||||
@@ -386,9 +386,9 @@ class TunnelsListTableViewCell: UITableViewCell {
|
|||||||
private var statusObservervationToken: AnyObject?
|
private var statusObservervationToken: AnyObject?
|
||||||
private var nameObservervationToken: AnyObject?
|
private var nameObservervationToken: AnyObject?
|
||||||
|
|
||||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
nameLabel = UILabel()
|
nameLabel = UILabel()
|
||||||
busyIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
|
busyIndicator = UIActivityIndicatorView(style: .gray)
|
||||||
busyIndicator.hidesWhenStopped = true
|
busyIndicator.hidesWhenStopped = true
|
||||||
statusSwitch = UISwitch()
|
statusSwitch = UISwitch()
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
|
|||||||
Reference in New Issue
Block a user