How would I monitor a folder for new files in swift, without polling (which is very inefficient)? I\'ve heard of APIs such as kqueue and FSEvents - but I\'m not sure it\'s p
The simplest solution is to use Apple's DirectoryMonitor.swift
https://developer.apple.com/library/mac/samplecode/Lister/Listings/ListerKit_DirectoryMonitor_swift.html
var dm = DirectoryMonitor(URL: AppDelegate.applicationDocumentsDirectory)
dm.delegate = self
dm.startMonitoring()