A simple wrapper around dispatch sources.
Switch branches/tags
Clone or download
Latest commit 10a8ed0 Aug 7, 2017

README.md

DAFileMonitor

Version License Platform

Description

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/

Usage

var fileMonitor = DAFileMonitor(withFilePath: filePath)
fileMonitor?.onFileEvent = {
    // This closure is called when your file changes.
}

Installation

DAFileMonitor is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DAFileMonitor"

Author

Dejan Agostini, dejan.agostini@gmail.com

License

DAFileMonitor is available under the MIT license. See the LICENSE file for more info.