aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
diff options
context:
space:
mode:
authorEric Kuck <eric@bluelinelabs.com>2018-12-12 11:40:57 -0600
committerEric Kuck <eric@bluelinelabs.com>2018-12-12 11:40:57 -0600
commitde14b76b4d99f74d52b6e404b2ab37394fa5b9dc (patch)
tree0d6e1efbf855bb4995b22e6c55ab8ab2f08e8f24 /WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
parentZip importing: importFromFile should take a completionHandler (diff)
downloadwireguard-apple-de14b76b4d99f74d52b6e404b2ab37394fa5b9dc.tar.xz
wireguard-apple-de14b76b4d99f74d52b6e404b2ab37394fa5b9dc.zip
Added swiftlint and fixed all errors (and a bunch, but not all, warnings)
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/iOS/QRScanViewController.swift11
1 files changed, 5 insertions, 6 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift b/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
index 207fc43..3849f70 100644
--- a/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
@@ -32,7 +32,7 @@ class QRScanViewController: UIViewController {
NSLayoutConstraint.activate([
tipLabel.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor),
tipLabel.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor),
- tipLabel.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -32),
+ tipLabel.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -32)
])
guard let videoCaptureDevice = AVCaptureDevice.default(for: .video),
@@ -118,12 +118,11 @@ class QRScanViewController: UIViewController {
self?.dismiss(animated: true, completion: nil)
}))
alert.addAction(UIAlertAction(title: NSLocalizedString("Save", comment: ""), style: .default, handler: { [weak self] _ in
- let title = alert.textFields?[0].text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
- if (title.isEmpty) { return }
+ guard let title = alert.textFields?[0].text?.trimmingCharacters(in: .whitespacesAndNewlines), !title.isEmpty else { return }
tunnelConfiguration.interface.name = title
- if let s = self {
- s.delegate?.addScannedQRCode(tunnelConfiguration: tunnelConfiguration, qrScanViewController: s) {
- s.dismiss(animated: true, completion: nil)
+ if let self = self {
+ self.delegate?.addScannedQRCode(tunnelConfiguration: tunnelConfiguration, qrScanViewController: self) {
+ self.dismiss(animated: true, completion: nil)
}
}
}))