Make Swift Cocoa app launch on startup on OS X 10.11
问题 I need to write a function that adds my application to Startup items on OS X 10.11. That's what I found at the moment: func applicationIsInStartUpItems() -> Bool { return (itemReferencesInLoginItems().existingReference != nil) } func itemReferencesInLoginItems() -> (existingReference: LSSharedFileListItemRef?, lastReference: LSSharedFileListItemRef?) { if let appUrl : NSURL = NSURL.fileURLWithPath(NSBundle.mainBundle().bundlePath) { let loginItemsRef = LSSharedFileListCreate(nil,