This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSSound { | |
static var systemSounds: [String] { | |
get { | |
var returnArr = [String]() | |
let librarySources = (NSSearchPathForDirectoriesInDomains(.libraryDirectory, .allDomainsMask, true) as NSArray).objectEnumerator() | |
var sourcePath = librarySources.nextObject() as? String | |
while (sourcePath != nil) { | |
let soundSource = FileManager.default.enumerator(atPath: URL(string: sourcePath!)!.appendingPathComponent("Sounds").absoluteString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import CloudKit | |
@NSApplicationMain | |
class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate { | |
func applicationDidFinishLaunching(_ notification: Notification) { | |
if #available(OSX 10.12, *) { | |
NSApp.registerForRemoteNotifications(matching: []) | |
} |