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

A RealmProperty instance represents an polymorphic value for supported types.

To change the underlying value stored by a RealmProperty instance, mutate the instance’s value property.


An RealmProperty should not be declared as @objc dynamic on a Realm Object. Use let instead.
  • Used for getting / setting the underlying value.

    • Usage: 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 }

Available where Value: Equatable

  • Declaration


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

Available where Value: Codable