<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPasteboard/detectedValues(for:inItemSet:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So12UIPasteboardC5UIKitE14detectedValues3for9inItemSetSayAbCE08DetectedD0VGShys14PartialKeyPathCyAHGG_10Foundation05IndexH0VSgtYaKF"
  },
  "title" : "detectedValues(for:inItemSet:)"
}
-->

# detectedValues(for:inItemSet:)

Requests that the data detection system asynchronously identify the types of values that you specify for the pasteboard item, and return the values that it matches for each pasteboard.

```
func detectedValues(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, inItemSet itemSet: IndexSet?) async throws -> [UIPasteboard.DetectedValues]
```

## Parameters

`keyPaths`

A set of key paths you use to indicate which types of values 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 values.

## Return Value

An array of objects that contain the values the data detection system matches in each pasteboard item.

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)