Instance Method



optional func application(_ application: NSApplication, open urls: [URL])



Your singleton app object.


An array of URLs to open. The list does not include URLs for which your app has a defined document type.


AppKit calls this method when your app is asked to open one or more URL-based resources. You must declare the URL types that your app supports in your Info.plist file using the CFBundleURLTypes key. The list can also include URLs for documents for which your app does not have an associated NSDocument class. You configure document types using Xcode, or by adding the CFBundleDocumentTypes key to your Info.plist file.

If your delegate implements this method, AppKit does not call the application(_:openFile:) or application(_:openFiles:) methods.

See Also

Opening Files

func application(NSApplication, openFile: String) -> Bool

Tells the delegate to open a single file.

func application(Any, openFileWithoutUI: String) -> Bool

Tells the delegate to open a file programmatically.

func application(NSApplication, openTempFile: String) -> Bool

Tells the delegate to open a temporary file.

func application(NSApplication, openFiles: [String])

Tells the delegate to open multiple files.

func applicationOpenUntitledFile(NSApplication) -> Bool

Tells the delegate to open an untitled file.

func applicationShouldOpenUntitledFile(NSApplication) -> Bool

Invoked immediately before opening an untitled file.