The applicationDidFinishLaunching
is not being called when I run my app.
This is the code of my AppDelegate
class:
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
let statusItem = NSStatusBar.system().statusItem(withLength: NSSquareStatusItemLength)
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
}
I am using Swift 3 and storyboards for my app.
The answer to applicationDidFinishLaunching - not triggering suggests to connect AppDelegate.swift
to application object in storyboard. I don't have any application object there.
My app does not have main menu, it is agent, as I am trying to build something similar to spotlight.
What should I do to get applicationDidFinishLaunching
running?