SyncSubscription

@frozen
public struct SyncSubscription

SyncSubscription is used to define a Flexible Sync subscription obtained from querying a subscription set, which can be used to read or remove/update a committed subscription.

Initializers

  • Name of the subscription, if not specified it will return the value in Query as a String.

    Declaration

    Swift

    public var name: String? { get }
  • When the subscription was created. Recorded automatically.

    Declaration

    Swift

    public var createdAt: Date { get }
  • When the subscription was last updated. Recorded automatically.

    Declaration

    Swift

    public var updatedAt: Date { get }
  • Updates a Flexible Sync’s subscription with an allowed query which will be used to bootstrap data from the server when committed.

    Warning

    This method may only be called during a write subscription block.

    Declaration

    Swift

    public func update<T>(toType type: T.Type, where query: @escaping (Query<T>) -> Query<Bool>) where T : RealmSwiftObject

    Parameters

    type

    The type of the object to be queried.

    query

    A query which will be used to modify the query.

  • Updates a Flexible Sync’s subscription with an allowed query which will be used to bootstrap data from the server when committed.

    Warning

    This method may only be called during a write subscription block.

    Declaration

    Swift

    public func update(to predicateFormat: String, _ args: Any...)

    Parameters

    predicateFormat

    A predicate format string, optionally followed by a variable number of arguments, which will be used to modify the query.

  • Updates a Flexible Sync’s subscription with an allowed query which will be used to bootstrap data from the server when committed.

    Warning

    This method may only be called during a write subscription block.

    Declaration

    Swift

    public func update(to predicate: NSPredicate)

    Parameters

    predicate

    The predicate with which to filter the objects on the server, which will be used to modify the query.