<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPasteboard/data(forPasteboardType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPasteboard(im)dataForPasteboardType:"
  },
  "title" : "data(forPasteboardType:)"
}
-->

# data(forPasteboardType:)

Returns the data on the pasteboard for the given representation type.

```
func data(forPasteboardType pasteboardType: String) -> Data?
```

## Parameters

`pasteboardType`

A string identifying a representation type of a pasteboard item.

## Return Value

A data object or `nil` if there is no data in the pasteboard of the given type.

## Discussion

The returned object often holds raw (binary) data, such as image data. This method works on the first item in the pasteboard. If there are other items, it ignores them.

---

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)