<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnyAttachmentContent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:19_RealityKit_SwiftUI20AnyAttachmentContentV"
  },
  "title" : "AnyAttachmentContent"
}
-->

# AnyAttachmentContent

A type-erased attachment content.

```
@MainActor @frozen @preconcurrency struct AnyAttachmentContent
```

## Overview

An `AnyAttachmentContent` allows changing the type of attachment used in a
given attachment content. Whenever the type of attachment content used with
an `AnyAttachmentContent` changes, the old content is destroyed and the new
content is created for the new type.

## Topics

### Initializers

[`init<Content>(Content)`](/documentation/RealityKit/AnyAttachmentContent/init(_:))

Creates an instance that type-erases [`AttachmentContent`](/documentation/RealityKit/AttachmentContent).

## Relationships

### Conforms To

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

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

[`AttachmentContent`](/documentation/RealityKit/AttachmentContent)

---

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)