【Realm】のaddNotificationBlock(_:)でValue of type 'Realm' has no member 'removeNotifications'エラー発生

古いソースをビルドしたらRealmCollection.addNotificationBlock(_:)でValue of type ‘Realm’ has no member ‘removeNotifications’と怒られました。
リリースノートをいろいろ調べたところ、Realmのv3.0.0で大幅に変更されていました。cocoapod使っててもこういったとこは結局直さなきゃいけないのはもどかしいですね。

Old API New API
NotificationToken.stop() NotificationToken.invalidate()
-[RLMNotificationToken stop] -[RLMNotificationToken invalidate]
RealmCollection.addNotificationBlock(_:) RealmCollection.observe(_:)
RLMSyncProgress RLMSyncProgressMode
List.remove(objectAtIndex:) List.remove(at:)
List.swap(_:_:) List.swapAt(_:_:)
SyncPermissionValue SyncPermission
RLMSyncPermissionValue RLMSyncPermission
-[RLMSyncPermission initWithRealmPath:userID:accessLevel] -[RLMSyncPermission initWithRealmPath:identity:accessLevel:]
RLMSyncPermission.userId RLMSyncPermission.identity
-[RLMRealm addOrUpdateObjectsInArray:] -[RLMRealm addOrUpdateObjects:]

 

    • The following APIs have been removed:

 
 
 

Removed API Replacement
Object.className None, was erroneously present.
RLMPropertyTypeArray RLMProperty.array
PropertyType.array Property.array
-[RLMArray sortedResultsUsingProperty:ascending:] -[RLMArray sortedResultsUsingKeyPath:ascending:]
-[RLMCollection sortedResultsUsingProperty:ascending:] -[RLMCollection sortedResultsUsingKeyPath:ascending:]
-[RLMResults sortedResultsUsingProperty:ascending:] -[RLMResults sortedResultsUsingKeyPath:ascending:]
+[RLMSortDescriptor sortDescriptorWithProperty:ascending:] +[RLMSortDescriptor sortDescriptorWithKeyPath:ascending:]
RLMSortDescriptor.property RLMSortDescriptor.keyPath
AnyRealmCollection.sorted(byProperty:ascending:) AnyRealmCollection.sorted(byKeyPath:ascending:)
List.sorted(byProperty:ascending:) List.sorted(byKeyPath:ascending:)
LinkingObjects.sorted(byProperty:ascending:) LinkingObjects.sorted(byKeyPath:ascending:)
Results.sorted(byProperty:ascending:) Results.sorted(byKeyPath:ascending:)
SortDescriptor.init(property:ascending:) SortDescriptor.init(keyPath:ascending:)
SortDescriptor.property SortDescriptor.keyPath
+[RLMRealm migrateRealm:configuration:] +[RLMRealm performMigrationForConfiguration:error:]
RLMSyncManager.disableSSLValidation RLMSyncConfiguration.enableSSLValidation
SyncManager.disableSSLValidation SyncConfiguration.enableSSLValidation
RLMSyncErrorBadResponse RLMSyncAuthErrorBadResponse
RLMSyncPermissionResults RLMResults
SyncPermissionResults Results
RLMSyncPermissionChange -[RLMSyncUser applyPermission:callback] / -[RLMSyncUser deletePermission:callback:]
-[RLMSyncUser permissionRealmWithError:] -[RLMSyncUser retrievePermissionsWithCallback:]
RLMSyncPermissionOffer -[RLMSyncUser createOfferForRealmAtURL:accessLevel:expiration:callback:]
RLMSyncPermissionOfferResponse -[RLMSyncUser acceptOfferForToken:callback:]
-[NSError rlmSync_clientResetBlock] -[NSError rlmSync_errorActionToken] / -[NSError rlmSync_clientResetBackedUpRealmPath]
-[NSError rlmSync_deleteRealmBlock] -[NSError rlmSync_errorActionToken]