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.
Declaration
Parameters
oldObjectThe object from the original Realm (read-only).
newObjectThe object from the migrated Realm (read-write).
-
A callback block for
RLMObjectnotifications.If the object is deleted from the managing Realm, the block is called with
deletedset toYESand the other two arguments arenil. The block will never be called again after this.If the object is modified, the block will be called with
deletedset toNO, anilerror, and an array ofRLMPropertyChangeobjects which indicate which properties of the objects were modified.If an error occurs,
deletedwill beNO,changeswill benil, anderrorwill include information about the error. The block will never be called again after an error occurs.Declaration
Objective-C
typedef void (^RLMObjectChangeBlock)(BOOL, NSArray<RLMPropertyChange *> *_Nullable, NSError *_Nullable)
-
A callback used to vend the results of a partial sync fetch.
Declaration
Objective-C
typedef void (^RLMPartialSyncFetchCallback)(RLMResults *_Nullable, NSError *_Nullable)
-
A log callback function which can be set on RLMSyncManager.
The log function may be called from multiple threads simultaneously, and is responsible for performing its own synchronization if any is required.
Declaration
Objective-C
typedef void (*RLMSyncLogFunction)(RLMSyncLogLevel, NSString *_Nonnull) -
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)
-
The type of a progress notification block intended for reporting a session’s network activity to the user.
transferredBytesrefers to the number of bytes that have been uploaded or downloaded.transferrableBytesrefers to the total number of bytes transferred, and pending transfer.Declaration
Objective-C
typedef void (^RLMProgressNotificationBlock)(NSUInteger, NSUInteger)
-
A block type used for APIs which asynchronously vend an
RLMSyncUser.Declaration
Objective-C
typedef void (^RLMUserCompletionBlock)(RLMSyncUser *_Nullable, NSError *_Nullable) -
A block type used to report the status of a password change operation. If the
NSErrorargument is nil, the operation succeeded.Declaration
Objective-C
typedef void (^RLMPasswordChangeStatusBlock)(NSError *_Nullable) -
A block type used to report the status of a permission apply or revoke operation. If the
NSErrorargument is nil, the operation succeeded.Declaration
Objective-C
typedef void (^RLMPermissionStatusBlock)(NSError *_Nullable) -
A block type used to report the status of a permission offer operation.
Declaration
Objective-C
typedef void (^RLMPermissionOfferStatusBlock)(NSString *_Nullable, NSError *_Nullable) -
A block type used to report the status of a permission offer response operation.
Declaration
Objective-C
typedef void (^RLMPermissionOfferResponseStatusBlock)(NSURL *_Nullable, NSError *_Nullable) -
A block type used to asynchronously report results of a permissions get operation. Exactly one of the two arguments will be populated.
Declaration
Objective-C
typedef void (^RLMPermissionResultsBlock)( NSArray<RLMSyncPermission *> *_Nullable, NSError *_Nullable) -
A block type used to asynchronously report results of a permission offerss get operation. Exactly one of the two arguments will be populated.
Declaration
Objective-C
typedef void (^RLMPermissionOfferResultsBlock)( NSArray<RLMSyncPermissionOffer *> *_Nullable, NSError *_Nullable) -
A block type used to asynchronously report results of a user info retrieval. Exactly one of the two arguments will be populated.
Declaration
Objective-C
typedef void (^RLMRetrieveUserBlock)(RLMSyncUserInfo *_Nullable, NSError *_Nullable) -
A block type used to report an error related to a specific user.
Declaration
Objective-C
typedef void (^RLMUserErrorReportingBlock)(RLMSyncUser *_Nonnull, NSError *_Nonnull)
-
A token originating from the Realm Object Server.
Declaration
Objective-C
typedef NSString *RLMServerToken
-
A notification indicating that changes were made to a Realm.
Declaration
Objective-C
typedef NSString *RLMNotification
-
A callback block for opening Realms asynchronously.
Returns the Realm if the open was successful, or an error otherwise.
Declaration
Objective-C
typedef void (^RLMAsyncOpenRealmCallback)(RLMRealm *_Nullable, NSError *_Nullable) -
The type of a block to run whenever the data within the Realm is modified.
Declaration
Objective-C
typedef void (^RLMNotificationBlock)(RLMNotification _Nonnull, RLMRealm *_Nonnull) -
The type of a migration block used to migrate a Realm.
Declaration
Objective-C
typedef void (^RLMMigrationBlock)(RLMMigration *_Nonnull, uint64_t)Parameters
migrationA
RLMMigrationobject used to perform the migration. The migration object allows you to enumerate and alter any existing objects which require migration.oldSchemaVersionThe schema version of the Realm being migrated.
-
A block called when opening a Realm for the first time during the life of a process to determine if it should be compacted before being returned to the user. It is passed the total file size (data + free space) and the total bytes used by data in the file.
Return
YESto indicate that an attempt to compact the file should be made. The compaction will be skipped if another process is accessing it.Declaration
Objective-C
typedef BOOL (^RLMShouldCompactOnLaunchBlock)(NSUInteger, NSUInteger)
-
A token representing an identity provider’s credentials.
Declaration
Objective-C
typedef NSString *RLMSyncCredentialsToken -
A type representing the unique identifier of a Realm Object Server identity provider.
Declaration
Objective-C
typedef NSString *RLMIdentityProvider
View on GitHub
Install in Dash
Type Definitions Reference