LinkingObjects
@frozen
public struct LinkingObjects<Element> : RealmCollectionImpl where Element : RLMObjectBase, Element : RealmCollectionValue
extension LinkingObjects: RealmSubscribable
extension LinkingObjects: _ObjcBridgeable
extension LinkingObjects: LinkingObjectsProtocol
extension LinkingObjects: _HasPersistedType, _Persistable where Element: _Persistable
LinkingObjects is an auto-updating container type. It represents zero or more objects that are linked to its owning
model object through a property relationship.
LinkingObjects can be queried with the same predicates as List<Element> and Results<Element>.
LinkingObjects always reflects the current state of the Realm on the current thread, including during write
transactions on the current thread. The one exception to this is when using for...in enumeration, which will always
enumerate over the linking objects that were present when the enumeration is begun, even if some of them are deleted or
modified to no longer link to the target object during the enumeration.
LinkingObjects can only be used as a property on Object models. Properties of this type must be declared as let
and cannot be dynamic.
-
Creates an instance of a
LinkingObjects. This initializer should only be called when declaring a property on a Realm model.Declaration
Swift
public init(fromType _: Element.Type, property propertyName: String)Parameters
typeThe type of the object owning the property the linking objects should refer to.
propertyNameThe property name of the property the linking objects should refer to.
-
A human-readable description of the objects represented by the linking objects.
Declaration
Swift
public var description: String { get }
-
Returns the object at the given
index.Declaration
Swift
public subscript(index: Int) -> Element { get }Parameters
indexThe index.
-
Declaration
Swift
public static func == (lhs: LinkingObjects<Element>, rhs: LinkingObjects<Element>) -> Bool
-
A publisher that emits Void each time the collection changes.
Despite the name, this actually emits after the collection has changed.
Declaration
Swift
public var objectWillChange: RealmPublishers.WillChange<LinkingObjects> { get } -
Undocumented
Declaration
Swift
public static var _rlmType: PropertyType { get } -
Undocumented
Declaration
Swift
public static var _rlmRequireObjc: Bool { get } -
Undocumented
Declaration
Swift
public static func _rlmPopulateProperty(_ prop: RLMProperty) -
Undocumented
Declaration
Swift
public func _rlmPopulateProperty(_ prop: RLMProperty)
-
Undocumented
Declaration
Swift
public typealias PersistedType = `Self` -
Undocumented
Declaration
Swift
public static func _rlmDefaultValue() -> LinkingObjects<Element> -
Undocumented
Declaration
Swift
public static func _rlmGetProperty(_ obj: ObjectBase, _ key: UInt16) -> LinkingObjects -
Undocumented
Declaration
Swift
public static func _rlmSetProperty(_ obj: ObjectBase, _ key: UInt16, _ value: LinkingObjects) -
Undocumented
Declaration
Swift
public static func _rlmSetAccessor(_ prop: RLMProperty)
View on GitHub
Install in Dash