Instance Method

application(_:handleOpen:)

Asks the delegate to open a resource identified by URL.

Declaration

optional func application(_ application: UIApplication, handleOpen url: URL) -> Bool

Parameters

application

Your singleton app object.

url

A object representing a URL (Universal Resource Locator). See the appendix of App Programming Guide for iOS for Apple-registered schemes for URLs.

Return Value

true if the delegate successfully handled the request; false if the attempt to handle the URL failed.

Discussion

If the delegate also implements the application(_:open:sourceApplication:annotation:) method, that method is called instead of this one.

This method is not called if the delegate returns false from both the application(_:willFinishLaunchingWithOptions:) and application(_:didFinishLaunchingWithOptions:) methods. (If only one of the two methods is implemented, its return value determines whether this method is called.) If your app implements the applicationDidFinishLaunching(_:) method instead of application(_:didFinishLaunchingWithOptions:), this method is called to open the specified URL after the app has been initialized.

If a URL arrives while your app is suspended or running in the background, the system moves your app to the foreground prior to calling this method.

There is no equivalent notification for this delegation method.

See Also

Related Symbols

func application(UIApplication, didFinishLaunchingWithOptions: [UIApplicationLaunchOptionsKey : Any]? = nil)

Tells the delegate that the launch process is almost done and the app is almost ready to run.

func application(UIApplication, willFinishLaunchingWithOptions: [UIApplicationLaunchOptionsKey : Any]? = nil)

Tells the delegate that the launch process has begun but that state restoration has not yet occurred.

func openURL(URL)

Attempts to open the resource at the specified URL.