Latest 0.0.6
Homepage https://github.com/hwaxxer/MHWDirectoryWatcher
License MIT
Platforms ios 5.0, osx 10.7, requires ARC
Authors

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.

Installing

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.

Example:

_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!

Latest podspec

{
    "name": "MHWDirectoryWatcher",
    "version": "0.0.6",
    "summary": "MHWDirectoryWatcher is a lightweight and efficient class that uses GCD to monitor a given directory for changes.",
    "homepage": "https://github.com/hwaxxer/MHWDirectoryWatcher",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Martin Hwasser": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hwaxxer/MHWDirectoryWatcher.git",
        "tag": "0.0.6"
    },
    "source_files": "MHWDirectoryWatcher/*",
    "requires_arc": true,
    "platforms": {
        "ios": "5.0",
        "osx": "10.7"
    }
}

Pin It on Pinterest

Share This