<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPasteControl",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPasteControl"
  },
  "title" : "UIPasteControl"
}
-->

# UIPasteControl

A button that a person taps to place pasteboard contents in your app.

```
@MainActor class UIPasteControl
```

## Overview

You can configure the button to appear as an icon, text, or both. The following button represents the icon and text option:

![A screenshot of a pill-shaped button with an icon of a paper sheet on top of a clipboard, and text that says Paste.](images/com.apple.uikit/media-4085675@2x.png)

In iOS 16 and later, programmatic pasting raises a user alert that prompts the user for approval before the app gains access to pasteboard contents (`UIPasteboard.general.string`). Use this class to paste without a user prompt.

### Add a paste button to a text view

The following code displays a paste button and assigns a text view as the recipient of pasteboard contents:

```swift
let textView = UITextView(frame: view.bounds)
view.addSubview(textView)

let configuration = UIPasteControl.Configuration()
configuration.baseBackgroundColor = .red
configuration.baseForegroundColor = .magenta
configuration.cornerStyle = .capsule
configuration.displayMode = .iconAndLabel
                    
let pasteButton = UIPasteControl(configuration: configuration)
pasteButton.frame = CGRect(x: view.bounds.width/2.0, y: view.bounds.height/2.0, width: 150, height: 60)
textView.addSubview(pasteButton)

pasteButton.target = textView
```

## Topics

### Creating a paste button

[`-  initWithCoder:`](/documentation/UIKit/UIPasteControl/init(coder:))

Creates a paste button by deserializing the specified coder.

[`-  initWithConfiguration:`](/documentation/UIKit/UIPasteControl/init(configuration:))

Creates a paste button that conforms to the specified configuration.

[`-  initWithFrame:`](/documentation/UIKit/UIPasteControl/init(frame:))

Creates a paste button with the specified size and position.

### Identifying the content recipient

[`target`](/documentation/UIKit/UIPasteControl/target)

The UI control that receives pasted content.

### Determining the button’s look

[`configuration`](/documentation/UIKit/UIPasteControl/configuration-swift.property)

An object that customizes the look of the paste button.

[`Configuration`](/documentation/UIKit/UIPasteControl/Configuration-swift.class)

An object that determines a paste button’s color, corner style, icon, and text.

## Relationships

### Conforms To

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

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CALayerDelegate`](/documentation/QuartzCore/CALayerDelegate)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

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

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

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

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

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

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

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

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

[`Equatable`](/documentation/Swift/Equatable)

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

[`Sendable`](/documentation/Swift/Sendable)

[`CVarArg`](/documentation/Swift/CVarArg)

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

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

[`NSCoding`](/documentation/Foundation/NSCoding)

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

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

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

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

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`Hashable`](/documentation/Swift/Hashable)

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

[`CMBodyIdentifiable`](/documentation/CoreMotion/CMBodyIdentifiable)

[`CLBodyIdentifiable`](/documentation/CoreLocation/CLBodyIdentifiable)

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

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

### Inherits From

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

---

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)