detectValues(for:inItemSet:completionHandler:)
Determines whether pasteboard items match the specified patterns, reading the contents if it finds a match.
Declaration
func detectValues(for patterns: Set<UIPasteboard.DetectionPattern>, inItemSet itemSet: IndexSet?, completionHandler: @escaping (Result<[[UIPasteboard.DetectionPattern : Any]], any Error>) -> ())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 in nil to request all pasteboard items.
- completionHandler:
A closure that the system invokes after detecting patterns on the pasteboard. The closure receives a
Resultinstance that contains either an array of dictionaries with the patterns and the associated values found on the pasteboard or an error if detection failed. IfResultcontains an array, the index of each element in the array corresponds to the pasteboard item index specified initemSet.
Discussion
For details about the types returned for each pattern, see UIPasteboard.DetectionPattern.