April 2015
Intermediate to advanced
556 pages
17h 47m
English
Every Cocoa application has a single instance of NSApplication and a single instance of a custom class named AppDelegate, which conforms to the NSApplicationDelegate protocol. When events happen in the lifecycle of the application, methods on the NSApplicationDelegate protocol are called. You implement these methods as needed in the “app delegate.”
Here are a few methods from the NSApplicationDelegate protocol:
optional func applicationDidFinishLaunching(_ aNotification: NSNotification) optional func application(_ application: NSApplication, willPresentError error: NSError) -> NSError optional func applicationShouldTerminate(_ sender: NSApplication) -> NSApplicationTerminateReply optional ...