---
title: UIPasteControl
framework: uikit
role: symbol
role_heading: Class
path: uikit/uipastecontrol
---

# UIPasteControl

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

## Declaration

```swift
@MainActor class UIPasteControl
```

## Overview

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

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: 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

- [init(coder:)](uikit/uipastecontrol/init(coder:).md)
- [init(configuration:)](uikit/uipastecontrol/init(configuration:).md)
- [init(frame:)](uikit/uipastecontrol/init(frame:).md)

### Identifying the content recipient

- [target](uikit/uipastecontrol/target.md)

### Determining the button’s look

- [configuration](uikit/uipastecontrol/configuration-swift.property.md)
- [UIPasteControl.Configuration](uikit/uipastecontrol/configuration-swift.class.md)

## Relationships

### Inherits From

- [UIControl](uikit/uicontrol.md)

### Conforms To

- [CALayerDelegate](quartzcore/calayerdelegate.md)
- [CLBodyIdentifiable](corelocation/clbodyidentifiable.md)
- [CMBodyIdentifiable](coremotion/cmbodyidentifiable.md)
- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [UIAccessibilityIdentification](uikit/uiaccessibilityidentification.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIAppearance](uikit/uiappearance.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UIContextMenuInteractionDelegate](uikit/uicontextmenuinteractiondelegate.md)
- [UICoordinateSpace](uikit/uicoordinatespace.md)
- [UIDynamicItem](uikit/uidynamicitem.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UIFocusItem](uikit/uifocusitem.md)
- [UIFocusItemContainer](uikit/uifocusitemcontainer.md)
- [UILargeContentViewerItem](uikit/uilargecontentvieweritem.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIPopoverPresentationControllerSourceItem](uikit/uipopoverpresentationcontrollersourceitem.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)

## See Also

### Pasteboard

- [UIPasteControl.Configuration](uikit/uipastecontrol/configuration-swift.class.md)
- [UIPasteControl.DisplayMode](uikit/uipastecontrol/displaymode.md)
- [UIPasteboard](uikit/uipasteboard.md)
- [UIPasteConfiguration](uikit/uipasteconfiguration.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
