detectedPatterns(for:inItemSet:)
Requests that the data detection system asynchronously identify the patterns that you specify for the pasteboard items, and return the patterns that it matches.
Declaration
func detectedPatterns(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, inItemSet itemSet: IndexSet?) async throws -> [Set<PartialKeyPath<UIPasteboard.DetectedValues>>]Parameters
- keyPaths:
A set of key paths you use to indicate which types of pattern you want the data detection system to match.
- itemSet:
A set of indexes you provide to indicate which pasteboard items the data detection system inspects to detect patterns.
Return Value
A set of key paths that represent the patterns the data detection system matches in the pasteboard.
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.