---
title: "data(forType:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspasteboarditem/data(fortype:)"
---

# data(forType:)

Returns the value for the specified type as a data object.

## Declaration

```swift
func data(forType type: NSPasteboard.PasteboardType) -> Data?
```

## Parameters

- `type`: A uniform type identifier string.

## Return Value

Return Value The value for the specified type as an NSData object.

## See Also

### Getting values

- [string(forType:)](appkit/nspasteboarditem/string(fortype:).md)
- [propertyList(forType:)](appkit/nspasteboarditem/propertylist(fortype:).md)
