One Logo Pool Ball
SwiftData · IOS API REFERENCE

Schema.Attribute.Option

struct · iOS 17.0+ · SDK 27.1

struct Option

Members (10)

static · iOS 17.0+

transformable

TypeScript
static transformableBy(transformerName: string): Schema_Attribute_Option
Swift declaration
static func transformable(by transformerName: String) -> Schema.Attribute.Option
static · iOS 17.0+

transformable

TypeScript
static transformableBy3509(transformerType: string): Schema_Attribute_Option
Swift declaration
static func transformable(by transformerType: ValueTransformer.Type) -> Schema.Attribute.Option

Transforms the property's value between an in-memory form and a persisted form.

get · iOS 17.0+

externalStorage

TypeScript
static get externalStorage(): Schema_Attribute_Option
Swift declaration
static var externalStorage: Schema.Attribute.Option { get }

Stores the property's value as binary data adjacent to the model storage.

get · iOS 17.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

get · iOS 17.0+

allowsCloudEncryption

TypeScript
static get allowsCloudEncryption(): Schema_Attribute_Option
Swift declaration
static var allowsCloudEncryption: Schema.Attribute.Option { get }

Stores the property's value in an encrypted form.

get · iOS 17.0+

preserveValueOnDeletion

TypeScript
static get preserveValueOnDeletion(): Schema_Attribute_Option
Swift declaration
static var preserveValueOnDeletion: Schema.Attribute.Option { get }

Preserves the property's value in the persistent history when the context deletes the owning model.

get · iOS 17.0+

unique

TypeScript
static get unique(): Schema_Attribute_Option
Swift declaration
static var unique: Schema.Attribute.Option { get }

Ensures the property's value is unique across all models of the same type.

get · iOS 27.0+

codable

TypeScript
static get codable(): Schema_Attribute_Option
Swift declaration
static var codable: Schema.Attribute.Option { get }

Do not attempt to store this property as a Composite - instead treat it as a Codable Data Blob on save

get · iOS 17.0+

ephemeral

TypeScript
static get ephemeral(): Schema_Attribute_Option
Swift declaration
static var ephemeral: Schema.Attribute.Option { get }

Track changes to this property but do not persist

get · iOS 17.0+

spotlight

TypeScript
static get spotlight(): Schema_Attribute_Option
Swift declaration
static var spotlight: Schema.Attribute.Option { get }

Indexes the property's value so it can appear in Spotlight search results.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftData types →