Contents

detectPatterns(for:completionHandler:)

Requests that the data detection system identify the patterns that you specify for the pasteboard, and provide the patterns that it matches to your closure.

Declaration

func detectPatterns(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, completionHandler: @escaping (Result<Set<PartialKeyPath<UIPasteboard.DetectedValues>>, any Error>) -> ())

Parameters

  • keyPaths:

    A set of key paths you use to indicate which types of patterns you want the data detection system to match.

  • completionHandler:

    A closure you provide to process patterns the data detection system matches, or to handle errors.

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

Deprecated