<!--
{
  "availability" : [
    "iOS: 27.2.0 -",
    "iPadOS: 27.2.0 -",
    "macCatalyst: 27.2.0 -",
    "macOS: 27.2.0 -",
    "visionOS: 27.2.0 -",
    "watchOS: 27.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/Transcript/DataAttachment/init(contentType:content:metadata:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels10TranscriptV14DataAttachmentV11contentType0F08metadataAE07UniformG11Identifiers6UTTypeV_0A00D0VAA16GeneratedContentVtcfc"
  },
  "title" : "init(contentType:content:metadata:)"
}
-->

# init(contentType:content:metadata:)

Creates a data attachment with the content type, content, and metadata
you provide.

```
init(contentType: UTType, content: Data, metadata: GeneratedContent = GeneratedContent(properties: [:]))
```

## Parameters

`contentType`

A `UTType` identifying how to interpret `content`.

`content`

A raw binary representation of the attachment.

`metadata`

Metadata pertinent to this attachment.

---

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)