<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextPasteItem",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextPasteItem"
  },
  "title" : "UITextPasteItem"
}
-->

# UITextPasteItem

The interface for obtaining information about, and interacting with, a text item for pasting or dropping.

```
@MainActor protocol UITextPasteItem : NSObjectProtocol
```

## Topics

### Accessing the text paste item’s data

[`var itemProvider: NSItemProvider`](/documentation/UIKit/UITextPasteItem/itemProvider)

The item provider for the item being pasted or dropped.

[`var localObject: Any?`](/documentation/UIKit/UITextPasteItem/localObject)

The custom local object that the copy or drag source optionally attached to the drag item.

### Getting the default attributes for a string

[`var defaultAttributes: [NSAttributedString.Key : Any]`](/documentation/UIKit/UITextPasteItem/defaultAttributes)

The dictionary of default attributes that the system applies, during pasting or dropping, to plaintext strings from an item provider.

### Setting a text paste item’s result value

[`func setResult(string: String)`](/documentation/UIKit/UITextPasteItem/setResult(string:))

Sets a text paste item’s textual value to a specified plaintext string from the item provider.

[`func setResult(attributedString: NSAttributedString)`](/documentation/UIKit/UITextPasteItem/setResult(attributedString:))

Sets a text paste item’s textual value to a specified attributed string from the item provider.

[`func setResult(attachment: NSTextAttachment)`](/documentation/UIKit/UITextPasteItem/setResult(attachment:))

Sets a text paste item’s attachment value to a specified value.

[`func setDefaultResult()`](/documentation/UIKit/UITextPasteItem/setDefaultResult())

Sets the text paste item’s value to the default value based on the item provider’s data.

[`func setNoResult()`](/documentation/UIKit/UITextPasteItem/setNoResult())

Sets the text paste item’s textual value to not include data from the item provider.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherited By

[`UISearchTextFieldPasteItem`](/documentation/UIKit/UISearchTextFieldPasteItem)

---

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)