<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MeshSkeletonCollection",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation22MeshSkeletonCollectionV"
  },
  "title" : "MeshSkeletonCollection"
}
-->

# MeshSkeletonCollection

An object that holds a collection of skeletons used by a mesh resource.

```
struct MeshSkeletonCollection
```

## Topics

### Initializers

[`init()`](/documentation/RealityKit/MeshSkeletonCollection/init())

[`init([MeshResource.Skeleton])`](/documentation/RealityKit/MeshSkeletonCollection/init(_:))

### Instance Properties

[`var count: Int`](/documentation/RealityKit/MeshSkeletonCollection/count)

Number of skeletons.

[`var isEmpty: Bool`](/documentation/RealityKit/MeshSkeletonCollection/isEmpty)

True if there are no skeletons.

### Instance Methods

[`func insert(MeshResource.Skeleton) -> Bool`](/documentation/RealityKit/MeshSkeletonCollection/insert(_:))

Add a new skeleton to the container. Returns true if added. Returns false if it already exists.

[`func remove(id: String) -> MeshResource.Skeleton?`](/documentation/RealityKit/MeshSkeletonCollection/remove(id:))

Remove a skeleton by id.

[`func removeAll()`](/documentation/RealityKit/MeshSkeletonCollection/removeAll())

Remove all the skeletons.

[`func update(MeshResource.Skeleton) -> MeshResource.Skeleton?`](/documentation/RealityKit/MeshSkeletonCollection/update(_:))

Update an existing skeleton. The old instance is returned.

### Subscripts

[`subscript(String) -> MeshResource.Skeleton?`](/documentation/RealityKit/MeshSkeletonCollection/subscript(_:))

Read a skeleton given its id.

## Relationships

### Conforms To

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

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

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

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

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

---

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)