Typealiases

The following typealiases are available globally.

  • An opaque token which is returned from methods which subscribe to changes to a Realm.

    See

    addNotificationBlock(_:)

    Declaration

    Swift

    public typealias NotificationToken = RLMNotificationToken
  • PropertyType is an enum describing all property types supported in Realm models.

    For more information, see Realm Models.

    Primitive types

    • Int
    • Bool
    • Float
    • Double

    Object types

    • String
    • Data
    • Date

    Relationships: Array (in Swift, List) and Object types

    Declaration

    Swift

    public typealias PropertyType = RLMPropertyType
  • An object class used during migrations.

    Declaration

    Swift

    public typealias MigrationObject = DynamicObject
  • The type of a migration block used to migrate a Realm.

    Declaration

    Swift

    public typealias MigrationBlock = (migration: Migration, oldSchemaVersion: UInt64) -> Void

    Parameters

    migration

    A RLMMigration object used to perform the migration. The migration object allows you to enumerate and alter any existing objects which require migration.

    oldSchemaVersion

    The schema version of the Realm being migrated.

  • A block type which provides both the old and new versions of an object in the Realm. Object properties can only be accessed using subscripting.

    Declaration

    Swift

    public typealias MigrationObjectEnumerateBlock = (oldObject: MigrationObject?, newObject: MigrationObject?) -> Void

    Parameters

    oldObject

    The object from the original Realm (read-only).

    newObject

    The object from the migrated Realm (read-write).