---
title: CodableRepresentation
framework: coretransferable
role: symbol
role_heading: Structure
path: coretransferable/codablerepresentation
---

# CodableRepresentation

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

## Declaration

```swift
@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
```

## Mentioned in

Choosing a transfer representation for a model type

## Overview

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 Defining file and data types for your app.

## Topics

### Creating a transfer representation

- [init(for:contentType:)](coretransferable/codablerepresentation/init(for:contenttype:).md)
- [init(for:contentType:encoder:decoder:)](coretransferable/codablerepresentation/init(for:contenttype:encoder:decoder:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [TransferRepresentation](coretransferable/transferrepresentation.md)

## See Also

### Data transfer

- [DataRepresentation](coretransferable/datarepresentation.md)
