RealmProperty

public final class RealmProperty<Value> : RLMSwiftValueStorage where Value : RealmPropertyType
extension RealmProperty: Equatable where Value: Equatable
extension RealmProperty: Codable where Value: Codable

RealmProperty 인스턴스는 지원되는 유형에 대한 다형성 값을 나타냅니다.

RealmProperty 인스턴스에 저장된 기본 값을 변경하려면 인스턴스의 value 속성을 변경합니다.

참고

RealmProperty 은(는) Realm 객체에서 @objc dynamic 으)로 선언해서는 안 됩니다. 대신 let 를 사용합니다.
  • 기본 값을 가져오거나 설정하는 데 사용됩니다.

    • 사용법: class MyObject: Object { let myAnyValue = RealmProperty<AnyRealmValue>() } // Setting myObject.myAnyValue.value = .string("hello") // Getting if case let .string(s) = myObject.myAnyValue.value { print(s) // Prints 'Hello' }

    선언

    스위프트

    public var value: Value { get set }

Value: Equatable에서 사용 가능

  • 선언

    스위프트

    public static func == (lhs: RealmProperty<Value>, rhs: RealmProperty<Value>) -> Bool

Value: Codable에서 사용 가능