QueryViewModel

open class QueryViewModel<T> : QueryObservable where T : ParseObject

A default implementation of the QueryObservable protocol. Suitable for ObjectObserved and can be used as a SwiftUI view model. Also can be used as a Combine publisher. See Apple’s documentation for more details.

  • Declaration

    Swift

    public var query: Query<T>
  • Declaration

    Swift

    public typealias Object = T
  • Updates and notifies when the new results have been retrieved.

    Declaration

    Swift

    open var results: [QueryViewModel<T>.Object] { get set }
  • Updates and notifies when the count of the results have been retrieved.

    Declaration

    Swift

    open var count: Int { get set }
  • Updates and notifies when there is an error retrieving the results.

    Declaration

    Swift

    open var error: ParseError? { get set }
  • Declaration

    Swift

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

    Swift

    open func find(options: API.Options = [])
  • Declaration

    Swift

    open func findAll(batchLimit: Int? = nil,
                      options: API.Options = [])
  • Declaration

    Swift

    open func first(options: API.Options = [])
  • Declaration

    Swift

    open func count(options: API.Options = [])
  • Declaration

    Swift

    open func aggregate(_ pipeline: [[String: Encodable]],
                        options: API.Options = [])