<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreTransferable",
  "identifier" : "/documentation/CoreTransferable/ProxyRepresentation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Transferable"
    ],
    "preciseIdentifier" : "s:16CoreTransferable19ProxyRepresentationV"
  },
  "title" : "ProxyRepresentation"
}
-->

# ProxyRepresentation

A transfer representation that uses another type’s transfer representation
as its own.

```
struct ProxyRepresentation<Item, ProxyRepresentation> where Item : Transferable, ProxyRepresentation : Transferable
```

## Overview

Use this representation to rely on an existing transfer representation
that’s suitable for the type.
For example,  a `Note` type might use the
<doc://com.apple.documentation/documentation/Swift/String> structure’s
built-in [`Transferable`](/documentation/CoreTransferable/Transferable) conformance —
a plain text representation — so it can be pasted into any text editor:

```
struct Note: Transferable {
    var body: String

    static var transferRepresentation: some TransferRepresentation {
        ProxyRepresentation(\.body)
    }
}
```

`ProxyRepresentation` makes it easy to provide alternative representations
for receivers that don’t support the preferred custom format.

```
 struct Todo: Transferable, Codable {
    var text: String
    var isDone = false

    static var transferRepresentation: some TransferRepresentation {
        CodableRepresentation(contentType: .todo)
        ProxyRepresentation(\.text)
    }
}

 extension UTType {
     static let todo = UTType(exportedAs: "com.example.todo")
 }
```

Write the order of the representations in the `transferRepresentation` property
from more preferred to less preferred. In the previous example, if the receiver knows
about the custom `com.example.todo` content type, it will receive that custom content type.
Using a `ProxyRepresentation` as the alternative lets people paste
the to-do item in any text editor that doesn’t support the `com.example.todo`
content type but works with text formats.

`ProxyRepresentation` is a convenience, and its evaluation isn’t supposed
to be calculation-heavy. Don’t perform long-running work
in `exporting` and `importing` closures. They shouldn’t contain
network requests, file operations, or other potentially time-consuming tasks
as they can cause delays during operations with `Transferable` items.

Use <doc://com.apple.documentation/documentation/CoreTransferable/FileRepresentation>
or <doc://com.apple.documentation/documentation/CoreTransferable/DataRepresentation>
to read and write files or for other lengthy tasks.

## Topics

### Creating a transfer representation

### Implementing a transfer representation

## Relationships

### Conforms To

[`TransferRepresentation`](/documentation/CoreTransferable/TransferRepresentation)

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

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

---

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)