e228ac9d99
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
41 lines
1.2 KiB
Swift
41 lines
1.2 KiB
Swift
// SPDX-License-Identifier: MIT
|
|
// Copyright © 2018 WireGuard LLC. All Rights Reserved.
|
|
|
|
import UIKit
|
|
import os.log
|
|
|
|
@UIApplicationMain
|
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
|
|
var window: UIWindow?
|
|
var mainVC: MainViewController?
|
|
|
|
func application(_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
|
|
let window = UIWindow(frame: UIScreen.main.bounds)
|
|
window.backgroundColor = UIColor.white
|
|
self.window = window
|
|
|
|
let mainVC = MainViewController()
|
|
window.rootViewController = mainVC
|
|
window.makeKeyAndVisible()
|
|
|
|
self.mainVC = mainVC
|
|
|
|
return true
|
|
}
|
|
|
|
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
|
defer {
|
|
do {
|
|
try FileManager.default.removeItem(at: url)
|
|
} catch {
|
|
os_log("Failed to remove item from Inbox: %{public}@", log: OSLog.default, type: .debug, url.absoluteString)
|
|
}
|
|
}
|
|
mainVC?.tunnelsListVC?.importFromFile(url: url)
|
|
return true
|
|
}
|
|
}
|