One Logo Pool Ball
SwiftData · IOS API REFERENCE

Schema.Relationship

class · iOS 17.0+ · SDK 27.1

final class Relationship

An object that describes the configuration and behavior of a relationship between two model classes.

Members (27)

get · iOS 17.0+

isToOneRelationship

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

deleteRule

TypeScript
get deleteRule(): Schema_Relationship_DeleteRule
Swift declaration
final var deleteRule: Schema.Relationship.DeleteRule
set · iOS 17.0+

deleteRule

TypeScript
set deleteRule(value: Schema_Relationship_DeleteRule)
Swift declaration
final var deleteRule: Schema.Relationship.DeleteRule
get · iOS 17.0+

destination

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

destination

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

inverseName

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

inverseName

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

isAttribute

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

isTransient

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

hashModifier

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

hashModifier

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

originalName

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

originalName

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

inverseKeyPath

TypeScript
get inverseKeyPath(): (SDKHandle) | null
Swift declaration
final var inverseKeyPath: AnyKeyPath?
set · iOS 17.0+

inverseKeyPath

TypeScript
set inverseKeyPath(value: (SDKHandle) | null)
Swift declaration
final var inverseKeyPath: AnyKeyPath?
get · iOS 17.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
final 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+

maximumModelCount

TypeScript
get maximumModelCount(): (number) | null
Swift declaration
final var maximumModelCount: Int?
set · iOS 17.0+

maximumModelCount

TypeScript
set maximumModelCount(value: (number) | null)
Swift declaration
final var maximumModelCount: Int?
get · iOS 17.0+

minimumModelCount

TypeScript
get minimumModelCount(): (number) | null
Swift declaration
final var minimumModelCount: Int?
set · iOS 17.0+

minimumModelCount

TypeScript
set minimumModelCount(value: (number) | null)
Swift declaration
final var minimumModelCount: Int?
get · iOS 17.0+

name

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

name

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

keypath

TypeScript
get keypath(): (SDKHandle) | null
Swift declaration
final var keypath: AnyKeyPath?
set · iOS 17.0+

keypath

TypeScript
set keypath(value: (SDKHandle) | null)
Swift declaration
final var keypath: AnyKeyPath?
get · iOS 17.0+

options

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

options

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

isUnique

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

Skipped declarations

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

Schema.Relationship.valueType

Passing a Swift type itself is not supported.

Schema.Relationship.init(_:deleteRule:minimumModelCount:maximumModelCount:originalName:inverse:hashModifier:)

A variable number of Swift arguments is not supported.

All SwiftData types →