<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPasteboard/contains(pasteboardTypes:inItemSet:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPasteboard(im)containsPasteboardTypes:inItemSet:"
  },
  "title" : "contains(pasteboardTypes:inItemSet:)"
}
-->

# contains(pasteboardTypes:inItemSet:)

Returns whether the specified pasteboard items contain data of the given representation types.

```
func contains(pasteboardTypes: [String], inItemSet itemSet: IndexSet?) -> Bool
```

## Parameters

`pasteboardTypes`

An array of strings, with each string identifying a representation type. Typically you use UTIs as pasteboard types.

`itemSet`

An index set with each integer value identifying a pasteboard item positionally in the pasteboard. Pass in `nil` to request all pasteboard items.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the pasteboard items identified by `itemSet` have data corresponding to the representation types specified by `pasteboardTypes`; otherwise, returns <doc://com.apple.documentation/documentation/Swift/false>.

## See Also

[`numberOfItems`](/documentation/UIKit/UIPasteboard/numberOfItems)

The number of items for 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)