Skip to content
Eon edited this page Apr 19, 2018 · 10 revisions

Extended example

let fileWatcher = FileWatcher(["~/Desktop/test/".tildePath])
        
fileWatcher!.callback = { /*[weak self]*/ event in//<--The weak self part enables you to interact with your app in a safe manner, not required
    Swift.print(self?.someVariable)//Outputs: a variable in your current class
    Swift.print(event.description)//Outputs: a description of the file change
}

filewatcher.start() // start monitoring

Initial Dev notes by Eonist:

https://github.com/eonist/FileWatcher/wiki/LiveEdit

Wants:

  • Better structure ✅
  • More swift like ✅
  • More CI bots 🤖
  • enum event types
  • Ability to Alter WatchList on the fly
  • More code examples
  • Support for running FileWatcher on. background thread
Clone this wiki locally