RLMProperty

@interface RLMProperty : NSObject

RLMProperty instances represent properties managed by a Realm in the context of an object schema. Such properties may be persisted to a Realm file or computed from other data from the Realm.

When using Realm, RLMProperty instances allow performing migrations and introspecting the database’s schema.

These property instances map to columns in the core database.

Properties

  • The name of the property.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull name;

    Swift

    var name: String { get }
  • The type of the property.

    Declaration

    Objective-C

    @property (nonatomic, readonly) RLMPropertyType type;

    Swift

    var type: RLMPropertyType { get }
  • Indicates whether this property is indexed.

    See

    RLMObject

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL indexed;

    Swift

    var indexed: Bool { get }
  • For RLMObject and RLMArray properties, the name of the class of object stored in the property.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *objectClassName;

    Swift

    var objectClassName: String? { get }
  • For linking objects properties, the property name of the property the linking objects property is linked to.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *linkOriginPropertyName;

    Swift

    var linkOriginPropertyName: String? { get }
  • Indicates whether this property is optional.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL optional;

    Swift

    var optional: Bool { get }
  • Indicates whether this property is an array.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL array;

    Swift

    var array: Bool { get }

Methods

  • Returns whether a given property object is equal to the receiver.

    Declaration

    Objective-C

    - (BOOL)isEqualToProperty:(nonnull RLMProperty *)property;

    Swift

    func isEqual(to property: RLMProperty) -> Bool