let addressString = String(string[string.startIndex ..< endOfIPAddress])
let address: IPAddress
if let addr = IPv4Address(addressString) {
- address = addr
+ address = addr
} else if let addr = IPv6Address(addressString) {
address = addr
} else {
let interfaceFields: [TunnelViewModel.InterfaceField] = [
.name, .publicKey, .addresses,
- .listenPort, .mtu, .dns
+ .listenPort, .mtu, .dns
]
let peerFields: [TunnelViewModel.PeerField] = [
return "Status"
} else if (section == 1) {
// Interface
- return "Interface"
+ return "Interface"
} else if ((numberOfPeerSections > 0) && (section < (2 + numberOfPeerSections))) {
// Peer
return "Peer"
keyLabel.translatesAutoresizingMaskIntoConstraints = false
keyLabel.textAlignment = .right
let widthRatioConstraint = NSLayoutConstraint(item: keyLabel, attribute: .width,
- relatedBy: .equal,
- toItem: self, attribute: .width,
- multiplier: 0.4, constant: 0)
+ relatedBy: .equal,
+ toItem: self, attribute: .width,
+ multiplier: 0.4, constant: 0)
// The "Persistent Keepalive" key doesn't fit into 0.4 * width on the iPhone SE,
// so set a CR priority > the 0.4-constraint's priority.
widthRatioConstraint.priority = .defaultHigh + 1
} else {
// What if a file provider extension didn't respect our 'documentTypes' parameter
self.showErrorAlert(title: "Invalid file extension",
- message: "Please select a WireGuard configuration file (.conf) or a zip archive (.zip) for importing")
+ message: "Please select a WireGuard configuration file (.conf) or a zip archive (.zip) for importing")
}
}
}
extension TunnelsListTableViewController: QRScanViewControllerDelegate {
func addScannedQRCode(tunnelConfiguration: TunnelConfiguration, qrScanViewController: QRScanViewController,
- completionHandler: (() -> Void)?) {
+ completionHandler: (() -> Void)?) {
tunnelsManager?.add(tunnelConfiguration: tunnelConfiguration) { (_, error) in
if let error = error {
ErrorPresenter.showErrorAlert(error: error, from: qrScanViewController, onDismissal: completionHandler)
}
func tableView(_ tableView: UITableView,
- trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
+ trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let deleteAction = UIContextualAction(style: .destructive, title: "Delete", handler: { [weak self] (_, _, completionHandler) in
guard let tunnelsManager = self?.tunnelsManager else { return }
let tunnel = tunnelsManager.tunnel(at: indexPath.row)
return
}
s.startActivation(tunnelConfiguration: tunnelConfiguration,
- resolvedEndpoints: resolvedEndpoints,
- completionHandler: completionHandler)
+ resolvedEndpoints: resolvedEndpoints,
+ completionHandler: completionHandler)
}
}
}
return
}
guard (vpnError.code == NEVPNError.configurationInvalid || vpnError.code == NEVPNError.configurationStale) else {
- os_log("Failed to activate tunnel: %{public}@", log: OSLog.default, type: .debug, "\(error)")
- status = .inactive
- completionHandler(error)
- return
+ os_log("Failed to activate tunnel: %{public}@", log: OSLog.default, type: .debug, "\(error)")
+ status = .inactive
+ completionHandler(error)
+ return
}
assert(vpnError.code == NEVPNError.configurationInvalid || vpnError.code == NEVPNError.configurationStale)
os_log("startActivation: Error says: %{public}@", log: OSLog.default, type: .debug,