RLMNotificationToken

Objective-C

@interface RLMNotificationToken : NSObject

Swift

@_nonSendable(_assumed) class RLMNotificationToken : NSObject, @unchecked Sendable

A token which is returned from methods which subscribe to changes to a Realm.

Change subscriptions in Realm return an RLMNotificationToken instance, which can be used to unsubscribe from the changes. You must store a strong reference to the token for as long as you want to continue to receive notifications. When you wish to stop, call the -invalidate method. Notifications are also stopped if the token is deallocated.

  • Stops notifications for the change subscription that returned this token.

    Declaration

    Objective-C

    - (_Bool)invalidate;

    Swift

    func invalidate() -> Bool

    Return Value

    True if the token was previously valid, and false if it was already invalidated.

  • Unavailable

    Renamed to -invalidate.

    Stops notifications for the change subscription that returned this token.

    Declaration

    Objective-C

    - (void)stop;