<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Assignables",
  "identifier" : "/documentation/Assignables/MergeablePartsContainer",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Assignables"
    ],
    "preciseIdentifier" : "s:11Assignables23MergeablePartsContainerP"
  },
  "title" : "MergeablePartsContainer"
}
-->

# MergeablePartsContainer

Objects conforming to this protocol allow
merging in other replicas of themselves or
merging in individual parts of themselves.

```
protocol MergeablePartsContainer : Hashable
```

## Topics

### Merging the parts

[`func merge(other: Self) throws -> Bool`](/documentation/Assignables/MergeablePartsContainer/merge(other:))

Merge another object of this type into this object.

[`func merge(partID: Self.PartID, partDataURL: URL) throws -> Bool`](/documentation/Assignables/MergeablePartsContainer/merge(partID:partDataURL:))

Merges an individual part into the specified part of this object.

### Exporting the parts

[`func export(partIDs: [Self.PartID]) async throws -> [Self.PartID : URL]`](/documentation/Assignables/MergeablePartsContainer/export(partIDs:))

Given a set of part identifiers, return a dictionary
of part ID to URL to the part data file for the requested parts.

### Getting the part identifiers

[`var partIDs: [Self.PartID]`](/documentation/Assignables/MergeablePartsContainer/partIDs)

Returns a collection of part IDs reflecting the manifest of parts available in the document.

[`typealias PartID`](/documentation/Assignables/MergeablePartsContainer/PartID)

The type for document layer IDs.

### Inspecting the parts

[`var isPartial: Bool`](/documentation/Assignables/MergeablePartsContainer/isPartial)

Documents are considered partial when they are reconstituted missing one or more of their associated document part IDs.
When a document is considered partial it is expected that we shouldn’t be able to both read or write to the parts that the document
has neither been reconstituted or merged with.

### Instance Methods

[`func exportParts(identifiedBy: [Self.PartID]) async throws -> [Self.PartID : MergeablePartData]`](/documentation/Assignables/MergeablePartsContainer/exportParts(identifiedBy:))

Given a set of part identifiers, return a dictionary
of part ID to part data.

[`func makePart(for: Self.PartID) throws -> MergeablePartData?`](/documentation/Assignables/MergeablePartsContainer/makePart(for:))

Creates data for the part with the given identifier.

[`func merge(Self) async throws -> Bool`](/documentation/Assignables/MergeablePartsContainer/merge(_:))

Merge another object of this type into this object.

[`func merge(partData: MergeablePartData, into: Self.PartID) async throws -> Bool`](/documentation/Assignables/MergeablePartsContainer/merge(partData:into:))

Merges an individual part into the specified part of this object.

## Relationships

### Conforming Types

[`AssignableDocument`](/documentation/Assignables/AssignableDocument)

[`AssignedWorkDocument`](/documentation/Assignables/AssignedWorkDocument)

### Inherits From

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

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

### Inherited By

[`MergeableDocument`](/documentation/Assignables/MergeableDocument)

---

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)