Property

public final class Property: CustomStringConvertible

This class represents properties persisted to Realm in an ObjectSchema.

When using Realm, Property objects allow performing migrations and introspecting the database’s schema.

These properties map to columns in the core database.

  • Property name.

    Declaration

    Swift

    public var name: String { return rlmProperty.name }
  • Property type.

    Declaration

    Swift

    public var type: PropertyType { return rlmProperty.type }
  • Whether this property is indexed.

    Declaration

    Swift

    public var indexed: Bool { return rlmProperty.indexed }
  • Whether this property is optional (can contain nil values).

    Declaration

    Swift

    public var optional: Bool { return rlmProperty.optional }
  • Object class name - specify object types for Object and List properties.

    Declaration

    Swift

    public var objectClassName: String? { return rlmProperty.objectClassName }
  • Returns a human-readable description of this property.

    Declaration

    Swift

    public var description: String { return rlmProperty.description }