AnyRealmValue

A enum for storing and retrieving values associated with an AnyRealmValue property.

  • Represents nil

  • An integer type.

  • A boolean type.

  • A floating point numeric type.

  • A double numeric type.

  • A string type.

  • A binary data type.

  • A date type.

  • A Realm Object type.

  • An ObjectId type.

  • A Decimal128 type.

  • A UUID type.

  • Returns an Int if that is what the stored value is, otherwise nil.

  • Returns a Bool if that is what the stored value is, otherwise nil.

  • Returns a Float if that is what the stored value is, otherwise nil.

  • Returns a Double if that is what the stored value is, otherwise nil.

  • Returns a String if that is what the stored value is, otherwise nil.

  • Returns Data if that is what the stored value is, otherwise nil.

  • Returns a Date if that is what the stored value is, otherwise nil.

  • Returns an ObjectId if that is what the stored value is, otherwise nil.

  • Returns a Decimal128 if that is what the stored value is, otherwise nil.

  • Returns a UUID if that is what the stored value is, otherwise nil.

  • Returns the stored value as a Realm Object of a specific type.

  • Returns a DynamicObject if the stored value is an Object, otherwise nil.

    Note: This allows access to an object stored in AnyRealmValue where you may not have the class information associated for it. For example if you are using Realm Sync and version 2 of your app sets an object into AnyRealmValue and that class does not exist in version 1 use this accessor to gain access to the object in the Realm.

  • Required for conformance to AddableType