Functions
The following functions are available globally.
-
Creates a publisher that emits the object each time the object changes.
Precondition
The object must be a managed object which has not been invalidated.Declaration
Swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public func valuePublisher<T>(_ object: T, keyPaths: [String]? = nil) -> RealmPublishers.Value<T> where T : RealmSwiftObjectParameters
objectA managed object to observe.
keyPathsThe publisher emits changes on these property keyPaths. If
nilthe publisher emits changes for every property.Return Value
A publisher that emits the object each time it changes.
-
Creates a publisher that emits the collection each time the collection changes.
Precondition
The collection must be a managed collection which has not been invalidated.Declaration
Swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public func valuePublisher<T>(_ collection: T, keyPaths: [String]? = nil) -> RealmPublishers.Value<T> where T : RealmCollection, T : RealmSubscribableParameters
objectA managed collection to observe.
keyPathsThe publisher emits changes on these property keyPaths. If
nilthe publisher emits changes for every property.Return Value
A publisher that emits the collection each time it changes.
-
Creates a publisher that emits the object each time the object changes.
Precondition
The object must be a managed object which has not been invalidated.Declaration
Swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public func valuePublisher<T>(_ projection: T, keyPaths: [String]? = nil) -> RealmPublishers.Value<T> where T : ProjectionObservable, T : RealmSubscribableParameters
objectA managed object to observe.
keyPathsThe publisher emits changes on these property keyPaths. If
nilthe publisher emits changes for every property.Return Value
A publisher that emits the object each time it changes.
-
Creates a publisher that emits an object changeset each time the object changes.
Precondition
The object must be a managed object which has not been invalidated.Declaration
Swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public func changesetPublisher<T>(_ object: T, keyPaths: [String]? = nil) -> RealmPublishers.ObjectChangeset<T> where T : RealmSwiftObjectParameters
objectA managed object to observe.
keyPathsThe publisher emits changes on these property keyPaths. If
nilthe publisher emits changes for every property.Return Value
A publisher that emits an object changeset each time the object changes.
-
Creates a publisher that emits an object changeset each time the object changes.
Precondition
The object must be a projection.Declaration
Swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public func changesetPublisher<T>(_ projection: T, keyPaths: [String]? = nil) -> RealmPublishers.ObjectChangeset<T> where T : ProjectionObservableParameters
projectionA projection of Realm Object to observe.
keyPathsThe publisher emits changes on these property keyPaths. If
nilthe publisher emits changes for every property.Return Value
A publisher that emits an object changeset each time the projection changes.
-
Creates a publisher that emits a collection changeset each time the collection changes.
Precondition
The collection must be a managed collection which has not been invalidated.Declaration
Swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public func changesetPublisher<T>(_ collection: T, keyPaths: [String]? = nil) -> RealmPublishers.CollectionChangeset<T> where T : RealmCollectionParameters
objectA managed collection to observe.
keyPathsThe publisher emits changes on these property keyPaths. If
nilthe publisher emits changes for every property.Return Value
A publisher that emits a collection changeset each time the collection changes.
-
Returns a Boolean indicating whether the errors are identical.
Declaration
Swift
public func == (lhs: Error, rhs: Error) -> Bool -
Returns the schema version for a Realm at a given local URL.
Throws
An
NSErrorthat describes the problem.Declaration
Swift
public func schemaVersionAtURL(_ fileURL: URL, encryptionKey: Data? = nil) throws -> UInt64Parameters
fileURLLocal URL to a Realm file.
encryptionKey64-byte key used to encrypt the file, or
nilif it is unencrypted.
View on GitHub
Install in Dash
Functions Reference