ObjectSchema

public final class ObjectSchema: CustomStringConvertible

This class represents Realm model object schemas.

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

Object schemas map to tables in the core database.

  • Returns the property with the given name, if it exists.

    Declaration

    Swift

    public subscript(propertyName: String) -> Property?
  • An array of Property instances representing the persisted properties of a class described by the schema.

    See

    Property

    Declaration

    Swift

    public var properties: [Property]
  • The name of the class the schema describes.

    Declaration

    Swift

    public var className: String { return rlmObjectSchema.className }
  • The property which serves as the primary key for the class the schema describes, if any.

    Declaration

    Swift

    public var primaryKeyProperty: Property?
  • Returns a human-readable description of the properties contained in the object schema.

    Declaration

    Swift

    public var description: String { return rlmObjectSchema.description }