<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "swift: 5.9.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/BackingData",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData07BackingB0P"
  },
  "title" : "BackingData"
}
-->

# BackingData

An interface for providing in-memory storage for a persistent model.

```
protocol BackingData<Model>
```

## Topics

### Associated Types

[`associatedtype Model : PersistentModel`](/documentation/SwiftData/BackingData/Model)

### Initializers

[`init(for: Self.Model.Type)`](/documentation/SwiftData/BackingData/init(for:))

### Instance Properties

[`var metadata: Any`](/documentation/SwiftData/BackingData/metadata)

[`var persistentModelID: PersistentIdentifier?`](/documentation/SwiftData/BackingData/persistentModelID)

### Instance Methods

[`func getTransformableValue<Value>(forKey: KeyPath<Self.Model, Value>) -> Value`](/documentation/SwiftData/BackingData/getTransformableValue(forKey:))

[`func getValue<Value>(forKey: KeyPath<Self.Model, Value>) -> Value`](/documentation/SwiftData/BackingData/getValue(forKey:)-1pric)

[`func getValue<Value, OtherModel>(forKey: KeyPath<Self.Model, Value>) -> Value`](/documentation/SwiftData/BackingData/getValue(forKey:)-209t6)

[`func getValue<Value>(forKey: KeyPath<Self.Model, Value>) -> Value`](/documentation/SwiftData/BackingData/getValue(forKey:)-5fis7)

[`func getValue<Value>(forKey: KeyPath<Self.Model, Value?>) -> Value?`](/documentation/SwiftData/BackingData/getValue(forKey:)-5fo8)

[`func getValue<Value, OtherModel>(forKey: KeyPath<Self.Model, Value>) -> Value`](/documentation/SwiftData/BackingData/getValue(forKey:)-8xj5n)

[`func setTransformableValue<Value>(forKey: KeyPath<Self.Model, Value>, to: Value)`](/documentation/SwiftData/BackingData/setTransformableValue(forKey:to:))

[`func setValue<Value>(forKey: KeyPath<Self.Model, Value>, to: Value)`](/documentation/SwiftData/BackingData/setValue(forKey:to:)-1mr4x)

[`func setValue<Value, OtherModel>(forKey: KeyPath<Self.Model, Value>, to: Value)`](/documentation/SwiftData/BackingData/setValue(forKey:to:)-2idfg)

[`func setValue<Value>(forKey: KeyPath<Self.Model, Value>, to: Value)`](/documentation/SwiftData/BackingData/setValue(forKey:to:)-4d7yr)

[`func setValue<Value, OtherModel>(forKey: KeyPath<Self.Model, Value>, to: Value)`](/documentation/SwiftData/BackingData/setValue(forKey:to:)-992es)

[`func setValue<Value>(forKey: KeyPath<Self.Model, Value?>, to: Value?)`](/documentation/SwiftData/BackingData/setValue(forKey:to:)-rzi4)

---

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)