---
title: "availableType(from:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspasteboarditem/availabletype(from:)"
---

# availableType(from:)

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

## Declaration

```swift
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

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

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

## See Also

### Getting types

- [types](appkit/nspasteboarditem/types.md)
