Contents

detectPatternsForPatterns:inItemSet:completionHandler:

Determines whether pasteboard items match the specified patterns, without notifying the user.

Declaration

- (void) detectPatternsForPatterns:(NSSet<NSString *> *) patterns inItemSet:(NSIndexSet *) itemSet completionHandler:(void (^)(NSArray<NSSet<NSString *> *> *, NSError *)) completionHandler;

Parameters

  • patterns:

    The patterns to detect on the pasteboard.

  • itemSet:

    An index set with each integer value identifying a pasteboard item positionally in the pasteboard. Pass nil to detect patterns in all pasteboard items.

  • completionHandler:

    A block that the system invokes after detecting patterns on the pasteboard. The block receives a Result instance that contains either an array with the patterns found on the pasteboard or an error if detection failed. If the Result instance contains an array, the index of each element in the array corresponds to the pasteboard item index specified in itemSet.

Discussion

Because this method only detects for the presence of patterns and does not read the contents of the pasteboard, the system doesn’t notify the user about reading the contents of the pasteboard.

See Also

Detecting patterns of content in pasteboard items