Type Definitions

The following type definitions are available globally.

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

    See

    -[RLMMigration enumerateObjects:block:]

    Declaration

    Objective-C

    typedef void (^RLMObjectMigrationBlock)(RLMObject *_Nullable,
                                            RLMObject *_Nullable)

    Swift

    typealias RLMObjectMigrationBlock = (RLMObject?, RLMObject?) -> Void

    Parameters

    oldObject

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

    newObject

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

  • The type of a block to run whenever the data within the Realm is modified.

    See

    -[RLMRealm addNotificationBlock:]

    Declaration

    Objective-C

    typedef void (^RLMNotificationBlock)(RLMNotification _Nonnull,
                                         RLMRealm *_Nonnull)

    Swift

    typealias RLMNotificationBlock = (RLMNotification, RLMRealm) -> Void
  • The type of a migration block used to migrate a Realm.

    Declaration

    Objective-C

    typedef void (^RLMMigrationBlock)(RLMMigration *_Nonnull, uint64_t)

    Swift

    typealias RLMMigrationBlock = (RLMMigration, 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 token representing an identity provider’s credential.

    Declaration

    Objective-C

    typedef NSString *RLMCredentialToken

    Swift

    typealias RLMCredentialToken = NSString
  • A type representing the unique identifier of a Realm Object Server identity provider.

    Declaration

    Objective-C

    typedef NSString *RLMIdentityProvider

    Swift

    struct RLMIdentityProvider : RawRepresentable, _SwiftNewtypeWrapper, Equatable, Hashable, Comparable, _ObjectiveCBridgeable
  • A block type representing a block which can be used to report a sync-related error to the application. If the error pertains to a specific session, that session will also be passed into the block.

    Declaration

    Objective-C

    typedef void (^RLMSyncErrorReportingBlock)(NSError *_Nonnull,
                                               RLMSyncSession *_Nullable)

    Swift

    typealias RLMSyncErrorReportingBlock = (Error, RLMSyncSession?) -> Void
  • A token originating from the Realm Object Server.

    Declaration

    Objective-C

    typedef NSString *RLMServerToken

    Swift

    typealias RLMServerToken = NSString
  • A notification indicating that changes were made to a Realm.

    Declaration

    Objective-C

    typedef NSString *RLMNotification