SyncSpace

public final class SyncSpace: ImmutableMappable

A container for the synchronized state of a Space

  • A token which needs to be present to perform a subsequent synchronization operation

    Declaration

    Swift

    fileprivate(set) public var syncToken = ""
  • List of Assets currently published on the Space being synchronized

    Declaration

    Swift

    public var assets: [Asset]
  • List of Entries currently published on the Space being synchronized

    Declaration

    Swift

    public var entries: [Entry]
  • Continue a synchronization with previous data.

    Declaration

    Swift

    public init(client: Client, syncToken: String, delegate: SyncSpaceDelegate)

    Parameters

    client

    The client to use for synchronization

    syncToken

    The sync token from a previous synchronization

    delegate

    A delegate for receiving updates to your data store

    Return Value

    An initialized synchronized space instance *

  • Perform a subsequent synchronization operation, updating this object with the latest content from Contentful.

    Calling this will mutate the instance and also return a reference to itself to the completion handler in order to allow chaining of operations.

    Declaration

    Swift

    @discardableResult public func sync(matching: [String: Any] = [:], completion: @escaping (Result<SyncSpace>) -> Void) -> URLSessionDataTask?

    Parameters

    matching

    Additional options for the synchronization

    completion

    A handler which will be called on completion of the operation

    Return Value

    The data task being used, enables cancellation of requests *

  • Perform a subsequent synchronization operation, updating this object with the latest content from Contentful.

    Calling this will mutate the instance and also return a reference to itself to the completion handler in order to allow chaining of operations.

    Declaration

    Swift

    public func sync(matching: [String: Any] = [:]) -> Observable<Result<SyncSpace>>

    Parameters

    matching

    Additional options for the synchronization

    Return Value

    A tuple of data task and a signal which fires on completion *