A lightweight class for monitoring a directory for changes on iOS.
Objective-C Ruby
Switch branches/tags
Failed to load latest commit information.
MHWDirectoryWatcher fixes compile issue for non-GNU language dialects May 7, 2015
MHWDirectoryWatcherExample.xcodeproj 0.0.3 fixes memory leak and adds example project Jul 22, 2013
MHWDirectoryWatcherExample Adds gitignore and uses correct method in example. Jul 23, 2013
LICENSE License file added. Dec 11, 2012
MHWDirectoryWatcher.podspec updates podspec to 0.0.7. fixes #6 May 7, 2015
README.md Update README.md Jan 20, 2015



MHWDirectoryWatcher is a lightweight class that uses GCD to monitor a given path for changes. When any change to the directory occurs, MHWDirectoryWatcher starts polling the monitored path, making sure that file transfers are finished before posting notifications.


Copy MHWDirectoryWatcher.h+m into your project.

(or use CocoaPods)

Usage via blocks

Get an instance of MHWDirectoryWatcher using the factory method +directoryWatcherAtPath:callback: and it will start monitoring the path immediately. Callback occurs after files have changed.


_dirWatcher = [MHWDirectoryWatcher directoryWatcherAtPath:kDocumentsFolder callback:^{
                  // Actions which should be performed when the files in the directory 
                  [self doSomethingNice];

Call -stopWatching / -startWatching to pause/resume.

Used in Kobo and Readmill (RIP, acquired by Dropbox).

If you like this repository and use it in your project, I'd love to hear about it!