Simple FSEvents wrapper for Swift
- Add
github "soh335/FileWatch"to your Cartfile. - Run
carthage update. - Add FileWatch.framework to Embedded Binaries.
import FileWatch
letfilewatch=try!FileWatch(paths:["/path/to/dir"], createFlag:[.UseCFTypes,.FileEvents], runLoop:RunLoop.current, latency:3.0, eventHandler:{ event inif event.flag.contains(.ItemIsFile){debugPrint(event.path)}})- MIT