<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/PasteButton/init(payloadType:onPaste:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11PasteButtonV11payloadType02onC0ACxm_ySayxGctc16CoreTransferable0I0Rzlufc"
  },
  "title" : "init(payloadType:onPaste:)"
}
-->

# init(payloadType:onPaste:)

Creates an instance that accepts values of the specified type.

```
nonisolated init<T>(payloadType: T.Type, onPaste: @escaping ([T]) -> Void) where T : Transferable
```

## Parameters

`payloadType`

The type that you want to paste via the `PasteButton`.

`onPaste`

The handler to call on trigger of the button with at least
one item of the specified `Transferable` type from the pasteboard.

---

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)