<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPasteboardItem/availableType(from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPasteboardItem(im)availableTypeFromArray:"
  },
  "title" : "availableType(from:)"
}
-->

# availableType(from:)

Returns from a given array of types the first type within the pasteboard item, according to the ordering of types.

```
func availableType(from types: [NSPasteboard.PasteboardType]) -> NSPasteboard.PasteboardType?
```

## Parameters

`types`

An array of strings representing UTIs, arranged in order of preference (most preferred as the 0th element in the array).

## Return Value

The first (according to the sender’s ordering of `types`) type in `types` contained in the pasteboard item, or `nil` if the receiver does not contain any types given in `types`.

## Discussion

The method checks for UTI conformance of the requested types, preferring an exact match to conformance.

---

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)