---
title: "detectPatternsForPatterns:completionHandler:"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipasteboard/detectpatternsforpatterns:completionhandler:"
---

# detectPatternsForPatterns:completionHandler:

Determines whether the first pasteboard item matches the specified patterns, without notifying the user.

## Declaration

```occ
- (void) detectPatternsForPatterns:(NSSet<NSString *> *) patterns completionHandler:(void (^)(NSSet<NSString *> *, NSError *)) completionHandler;
```

## Parameters

- `patterns`: The patterns to detect on the pasteboard.
- `completionHandler`: A block that the system invokes after detecting patterns on the pasteboard. The block receives a Result instance that contains either a set with the patterns found on the pasteboard or an error if detection failed.

## Discussion

Discussion Because this method only gives an indication of whether a pasteboard item matches a particular pattern and doesn’t allow the app to access the contents, the system doesn’t notify the user about reading the contents of the pasteboard.

## See Also

### Detecting patterns of content in pasteboard items

- [detectPatternsForPatterns:inItemSet:completionHandler:](uikit/uipasteboard/detectpatternsforpatterns:initemset:completionhandler:.md)
- [detectValuesForPatterns:completionHandler:](uikit/uipasteboard/detectvaluesforpatterns:completionhandler:.md)
- [detectValuesForPatterns:inItemSet:completionHandler:](uikit/uipasteboard/detectvaluesforpatterns:initemset:completionhandler:.md)
- [UIPasteboard.DetectionPattern](uikit/uipasteboard/detectionpattern.md)
