Skip to content

Instantly share code, notes, and snippets.

View Iomegan's full-sized avatar

Daniel Witt Iomegan

View GitHub Profile
@Iomegan
Iomegan / MacSystemSoundsExtension.swift
Last active January 20, 2022 12:37
Array of all installed system sounds
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)
@Iomegan
Iomegan / CloudKitController.swift
Last active October 23, 2019 17:28
CloudKit Example Controller (macOS 10.12+)
import Cocoa
import CloudKit
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
if #available(OSX 10.12, *) {
NSApp.registerForRemoteNotifications(matching: [])
}