Skip to content

Instantly share code, notes, and snippets.

@aronbalog
Last active July 26, 2019 19:25
Show Gist options
  • Save aronbalog/0f1f6498f083e6562f9db2ff9280a9f9 to your computer and use it in GitHub Desktop.
Save aronbalog/0f1f6498f083e6562f9db2ff9280a9f9 to your computer and use it in GitHub Desktop.
import UIKit
import CoreNavigation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? = UIWindow()
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
registerRoutes()
let rootViewController = try! Color().viewController()
window?.rootViewController = UINavigationController(rootViewController: rootViewController)
window?.makeKeyAndVisible()
return true
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
do {
try userActivity.navigate()
} catch {
return false
}
return true
}
func registerRoutes() {
Color.self <- [
"https://demo7377577.mockable.io/color/:color([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",
"https://demo7377577.mockable.io/colour/:color([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",
"http://demo7377577.mockable.io/color/:color([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",
"http://demo7377577.mockable.io/colour/:color([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment