wireguard-apple/WireGuard/Coordinators/AppCoordinator+TunnelInfoTableViewControllerDelegate.swift
Jeroen Leenarts a55eefcd5d Fixe file/function related warnings.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-26 11:21:53 +02:00

20 lines
635 B
Swift

//
// Copyright © 2018 WireGuard LLC. All rights reserved.
//
import Foundation
extension AppCoordinator: TunnelInfoTableViewControllerDelegate {
func configure(tunnel: Tunnel, tunnelInfoTableViewController: TunnelInfoTableViewController) {
print("configure tunnel \(tunnel)")
let editContext = persistentContainer.newBackgroundContext()
var backgroundTunnel: Tunnel?
editContext.performAndWait {
backgroundTunnel = editContext.object(with: tunnel.objectID) as? Tunnel
}
showTunnelConfigurationViewController(tunnel: backgroundTunnel, context: editContext)
}
}