Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 896 Bytes

AppDelegate.md

File metadata and controls

32 lines (24 loc) · 896 Bytes

AppDelegate

Launching App from an URL

TODO: How to register a scheme for your app.

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        // sb: this should never happen, as we only have one scheme registered,
        // but just in case.
        if url.scheme != "YOUR REGISTERED SCHEME" {
            return false
        }

        // sb: segue to reset password
        if url.path == "/reset-password" {
            self.window!.rootViewController!.performSegue(withIdentifier: "segueToResetPassword", sender: self)
            return true
        }

        return false
    }
}

Links