One Logo Pool Ball
SwiftData · IOS API REFERENCE

Schema.Attribute

class · iOS 17.0+ · SDK 27.1

class Attribute

An object that describes the configuration and behavior of a specific property of a model class.

Members (19)

get · iOS 17.0+

isAttribute

TypeScript
get isAttribute(): boolean
Swift declaration
var isAttribute: Bool { get }
get · iOS 17.0+

isOptional

TypeScript
get isOptional(): boolean
Swift declaration
var isOptional: Bool
set · iOS 17.0+

isOptional

TypeScript
set isOptional(value: boolean)
Swift declaration
var isOptional: Bool
get · iOS 17.0+

isTransient

TypeScript
get isTransient(): boolean
Swift declaration
var isTransient: Bool { get }
get · iOS 17.0+

defaultValue

TypeScript
get defaultValue(): (unknown) | null
Swift declaration
var defaultValue: Any?
set · iOS 17.0+

defaultValue

TypeScript
set defaultValue(value: (unknown) | null)
Swift declaration
var defaultValue: Any?
get · iOS 17.0+

hashModifier

TypeScript
get hashModifier(): (string) | null
Swift declaration
var hashModifier: String?
set · iOS 17.0+

hashModifier

TypeScript
set hashModifier(value: (string) | null)
Swift declaration
var hashModifier: String?
get · iOS 17.0+

originalName

TypeScript
get originalName(): string
Swift declaration
var originalName: String
set · iOS 17.0+

originalName

TypeScript
set originalName(value: string)
Swift declaration
var originalName: String
get · iOS 17.0+

isRelationship

TypeScript
get isRelationship(): boolean
Swift declaration
var isRelationship: Bool { get }
get · iOS 17.0+

isTransformable

TypeScript
get isTransformable(): boolean
Swift declaration
var isTransformable: Bool { get }
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+

name

TypeScript
get name(): string
Swift declaration
var name: String
set · iOS 17.0+

name

TypeScript
set name(value: string)
Swift declaration
var name: String
get · iOS 17.0+

options

TypeScript
get options(): Array<Schema_Attribute_Option>
Swift declaration
var options: [Schema.Attribute.Option]
set · iOS 17.0+

options

TypeScript
set options(value: Array<Schema_Attribute_Option>)
Swift declaration
var options: [Schema.Attribute.Option]
get · iOS 17.0+

isUnique

TypeScript
get isUnique(): boolean
Swift declaration
var isUnique: Bool { get }
get · iOS 27.0+

isCodable

TypeScript
get isCodable(): boolean
Swift declaration
var isCodable: Bool { get }

Skipped declarations

3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

Schema.Attribute.valueType

Passing a Swift type itself is not supported.

Schema.Attribute.init(_:originalName:hashModifier:)

A variable number of Swift arguments is not supported.

Schema.Attribute.init(name:originalName:options:valueType:defaultValue:hashModifier:)

Passing a Swift type itself is not supported.

All SwiftData types →