<!--
{
  "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/CodableRepresentation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Transferable"
    ],
    "preciseIdentifier" : "s:16CoreTransferable21CodableRepresentationV"
  },
  "title" : "CodableRepresentation"
}
-->

# CodableRepresentation

A transfer representation for types that participate in Swift’s protocols for encoding and decoding.

```
@preconcurrency struct CodableRepresentation<Item, Encoder, Decoder> where Item : Transferable, Item : Decodable, Item : Encodable, Encoder : TopLevelEncoder, Encoder : Sendable, Decoder : TopLevelDecoder, Decoder : Sendable, Encoder.Output == Data, Decoder.Input == Data
```

## Overview

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

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

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

> Important: If your app declares custom uniform type identifiers,
> include corresponding entries in the app’s `Info.plist`.
> For more information, see <doc://com.apple.documentation/documentation/UniformTypeIdentifiers/defining-file-and-data-types-for-your-app>.

## Topics

### Creating a transfer representation

[`init(for:contentType:)`](/documentation/CoreTransferable/CodableRepresentation/init(for:contentType:))

Creates a transfer representation for a given type and type identifier.

[`init(for:contentType:encoder:decoder:)`](/documentation/CoreTransferable/CodableRepresentation/init(for:contentType:encoder:decoder:))

Creates a transfer representation for a given type with the encoder and decoder you supply.

### Implementing a transfer representation

## Relationships

### Conforms To

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

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

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

---

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)