---
title: types
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nspasteboard/types
---

# types

An array of the receiver’s supported data types.

## Declaration

```swift
var types: [NSPasteboard.PasteboardType]? { get }
```

## Discussion

Discussion The types array is an array of NSString objects containing the union of the types of data declared for all the pasteboard items on the receiver. The returned types are listed in the order they were declared. It’s a good idea to check the value of types (or call availableType(from:)) before reading any data from an NSPasteboard object. If you need to see if a type in the types array matches a type string you have stored locally, use the isEqual(to:) method to perform the comparison.

## See Also

### Related Documentation

- [declareTypes(_:owner:)](appkit/nspasteboard/declaretypes(_:owner:).md)
- [data(forType:)](appkit/nspasteboard/data(fortype:).md)

### Validating contents

- [availableType(from:)](appkit/nspasteboard/availabletype(from:).md)
- [canReadItem(withDataConformingToTypes:)](appkit/nspasteboard/canreaditem(withdataconformingtotypes:).md)
- [canReadObject(forClasses:options:)](appkit/nspasteboard/canreadobject(forclasses:options:).md)
- [types(filterableTo:)](appkit/nspasteboard/types(filterableto:).md)
