Instance Method

open(_:completionHandler:)

Asks the system to open a URL on behalf of the currently running app extension.

Declaration

func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil)

Parameters

URL

The URL to open.

completionHandler

A closure to be called when the URL has opened.

The closure takes a single parameter, a Boolean value that indicates whether the open operation was successful.

Discussion

Each extension point determines whether to support this method, or under which conditions to support this method. In iOS, the Today and iMessage app extension points support this method. An iMessage app extension can use this method only to open its parent app, and only if the parent app is shown on the iOS home screen.