Instance Method


Opens the location at the specified URL.


func open(_ url: URL) -> Bool



A URL specifying the location to open.

Return Value

true if the location was successfully opened; otherwise, false.


It is safe to call this method from any thread in macOS 10.6 and later.

See Also

Opening Files

func openFile(String)

Opens the specified file specified using the default app associated with its type.

func openFile(String, withApplication: String?)

Opens a file using the specified app.

func openFile(String, withApplication: String?, andDeactivate: Bool)

Opens the specified file and optionally deactivates the sending app.

func openFile(String, from: NSImage?, at: NSPoint, in: NSView?)

Opens a file using the default app for its type and animates the action using a custom icon.