application(_:open:)
Tells the delegate to open the resource at the specified URL.
Declaration
@MainActor optional func application(_ application: NSApplication, open urls: [URL])Parameters
- application:
Your singleton app object.
- urls:
An array of URLs to open. The list does not include URLs for which your app has a defined document type.
Discussion
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.