<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPasteboard/types",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPasteboard(py)types"
  },
  "title" : "types"
}
-->

# types

An array of the receiver’s supported data types.

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

## Discussion

The [`types`](/documentation/AppKit/NSPasteboard/types) array is an array of <doc://com.apple.documentation/documentation/Foundation/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`](/documentation/AppKit/NSPasteboard/types) (or call [`availableType(from:)`](/documentation/AppKit/NSPasteboard/availableType(from:))) before reading any data from an `NSPasteboard` object. If you need to see if a type in the [`types`](/documentation/AppKit/NSPasteboard/types) array matches a type string you have stored locally, use the <doc://com.apple.documentation/documentation/Foundation/NSString/isEqual(to:)> method to perform the comparison.

## See Also

[`-  declareTypes:owner:`](/documentation/AppKit/NSPasteboard/declareTypes(_:owner:))

Prepares the receiver for a change in its contents by declaring the new types of data it will contain and a new owner.

[`-  dataForType:`](/documentation/AppKit/NSPasteboard/data(forType:))

Returns the data for the specified type from the first item in the receiver that contains the type.



---

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)