Subscription

@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
open class Subscription<T> : ParseSubscription, ObservableObject where T : ParseObject

A default implementation of the ParseSubscription protocol. Suitable for ObjectObserved as the subscription can be used as a SwiftUI publisher. Meaning it can serve indepedently as a ViewModel in MVVM.

  • Declaration

    Swift

    public typealias Object = T
  • Updates and notifies when there’s a new event related to a specific query.

    Declaration

    Swift

    public internal(set) var event: (query: Query<T>, event: Event<T>)? { get set }
  • Updates and notifies when a subscription request has been fulfilled and if it is new.

    Declaration

    Swift

    public internal(set) var subscribed: (query: Query<T>, isNew: Bool)? { get set }
  • Updates and notifies when an unsubscribe request has been fulfilled.

    Declaration

    Swift

    public internal(set) var unsubscribed: Query<T>? { get set }
  • Creates a new subscription that can be used to handle updates.

    Declaration

    Swift

    public init(query: Query<T>)
  • Declaration

    Swift

    open func didReceive(_ eventData: Data) throws
  • Declaration

    Swift

    open func didSubscribe(_ new: Bool)
  • Declaration

    Swift

    open func didUnsubscribe()