With this library you can monitor a file for changes and you will receive a callback when the file changes. It's as simple as that :) The library itself is a wrapper around dispatch sources.
You can read more about the library on my blog: http://agostini.tech/2017/08/06/monitoring-files-using-dispatch-sources/
var fileMonitor = DAFileMonitor(withFilePath: filePath)
fileMonitor?.onFileEvent = {
// This closure is called when your file changes.
}
DAFileMonitor is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "DAFileMonitor"
Dejan Agostini, dejan.agostini@gmail.com
DAFileMonitor is available under the MIT license. See the LICENSE file for more info.