KSTFileWatcher

@interface KSTFileWatcher : NSObject

KSTFileWatcher wraps the GCD APIs related to the kqueue file notification mechanism.

  • Get the file URLs that are being watched.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<NSURL *> *_Nonnull URLs;
  • Get the flags passed in during creation.

    Declaration

    Objective-C

    @property (nonatomic, readonly) KSTFileWatcherFlags flags;
  • Returns [self initWithURLs:URLs flags:KSTFileWatcherFlagsAll block:block].

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURLs:(nonnull NSArray<NSURL *> *)URLs
                                   block:(nonnull KSTFileWatcherBlock)block;

    Parameters

    URLs

    The file/directory URLs to watch

    block

    The block to invoke when an event occurs

    Return Value

    The initialized instance

  • Creates and returns an instance of the receiver to watch the provided file/directory URLs and invoke the provided block whenever an event occurs. The provided block is always invoked on a private background queue.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURLs:(nonnull NSArray<NSURL *> *)URLs
                                   flags:(KSTFileWatcherFlags)flags
                                   block:(nonnull KSTFileWatcherBlock)block;

    Parameters

    URLs

    The file/directory URLs to watch

    flags

    The flags determining when to generate events

    block

    The block to invoke when an event occurs

    Return Value

    The initialized instance

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    + (instancetype)new NS_UNAVAILABLE;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;