Contents

detectValues(for:completionHandler:)

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

Declaration

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

Parameters

  • keyPaths:

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

  • completionHandler:

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

Discussion

Because this method gives the app access to the values it detects in the pasteboard, the system notifies the user about reading the contents of the pasteboard.

See Also

Detecting patterns of content in pasteboard items