---
title: "itemSet(withPasteboardTypes:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipasteboard/itemset(withpasteboardtypes:)"
---

# itemSet(withPasteboardTypes:)

Returns an index set identifying pasteboard items having the specified representation types.

## Declaration

```swift
func itemSet(withPasteboardTypes pasteboardTypes: [String]) -> IndexSet?
```

## Parameters

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

## Return Value

Return Value An index set with each integer positionally identifying a pasteboard item that has one of the representation types specified in pasteboardTypes.

## Discussion

Discussion You can pass the index set returned in this method in a call to data(forPasteboardType:inItemSet:) or values(forPasteboardType:inItemSet:) to get the data in the indicated pasteboard items.

## See Also

### Related Documentation

- [numberOfItems](uikit/uipasteboard/numberofitems.md)

### Determining types of pasteboard items

- [types](uikit/uipasteboard/types.md)
- [types(forItemSet:)](uikit/uipasteboard/types(foritemset:).md)
- [contains(pasteboardTypes:)](uikit/uipasteboard/contains(pasteboardtypes:).md)
- [contains(pasteboardTypes:inItemSet:)](uikit/uipasteboard/contains(pasteboardtypes:initemset:).md)
