}
// MARK: Converting to and from String
-// For use in the UI
extension DNSServer {
init?(from addressString: String) {
}
// MARK: Codable
-// For serializing to disk
@available(OSX 10.14, iOS 12.0, *)
extension DNSServer: Codable {
}
// MARK: Converting to and from String
-// For use in the UI
extension Endpoint {
init?(from string: String) {
}
// MARK: Codable
-// For serializing to disk
@available(OSX 10.14, iOS 12.0, *)
extension Endpoint: Codable {
}
// MARK: Converting to and from String
-// For use in the UI
extension IPAddressRange {
init?(from string: String) {
}
// MARK: Codable
-// For serializing to disk
@available(OSX 10.14, iOS 12.0, *)
extension IPAddressRange: Codable {
DispatchQueue.main.async {
let activityVC = UIActivityViewController(activityItems: [destinationURL], applicationActivities: nil)
- // popoverPresentationController shall be non-nil on the iPad
activityVC.popoverPresentationController?.sourceView = sourceView
activityVC.popoverPresentationController?.sourceRect = sourceView.bounds
activityVC.completionWithItemsHandler = { _, _, _, _ in
tableView.register(KeyValueCell.self)
tableView.register(ButtonCell.self)
- // State restoration
restorationIdentifier = "TunnelDetailVC:\(tunnel.name)"
}
alert.addAction(destroyAction)
alert.addAction(cancelAction)
- // popoverPresentationController will be nil on iPhone and non-nil on iPad
alert.popoverPresentationController?.sourceView = sourceView
alert.popoverPresentationController?.sourceRect = sourceView.bounds
alert.addAction(destroyAction)
alert.addAction(cancelAction)
- // popoverPresentationController will be nil on iPhone and non-nil on iPad
alert.popoverPresentationController?.sourceView = sourceView
alert.popoverPresentationController?.sourceRect = sourceView.bounds
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)
alert.addAction(cancelAction)
- // popoverPresentationController will be nil on iPhone and non-nil on iPad
if let sender = sender as? UIBarButtonItem {
alert.popoverPresentationController?.barButtonItem = sender
} else if let sender = sender as? UIView {
let packetTunnelSettingsGenerator = PacketTunnelSettingsGenerator(tunnelConfiguration: tunnelConfiguration, resolvedEndpoints: resolvedEndpoints)
- // Bring up wireguard-go backend
-
let fileDescriptor = packetFlow.value(forKeyPath: "socket.fileDescriptor") as! Int32 //swiftlint:disable:this force_cast
if fileDescriptor < 0 {
wg_log(.error, staticMessage: "Starting tunnel failed: Could not determine file descriptor")