Parse platform 如何在swift 3中使用ParseLiveQuery?

Parse platform 如何在swift 3中使用ParseLiveQuery?,parse-platform,swift3,cocoapods,Parse Platform,Swift3,Cocoapods,如何在swift 3中使用ParseLiveQuery?使用椰子荚。步骤1: 首先安装cocoaPod target 'MyApp' do pod 'ParseLiveQuery', '~> 1.1' end 然后在终端内部或从CocoaPods.app运行pod安装 第2步:根据文档 LiveQuery客户端界面基于订阅的概念。只需在查询上调用subscribe(),即可从关联的live query服务器注册任何PFQuery实时更新: let myQuery = Message.

如何在swift 3中使用ParseLiveQuery?使用椰子荚。

步骤1:

首先安装cocoaPod

target 'MyApp' do
  pod 'ParseLiveQuery', '~> 1.1'
end
然后在终端内部或从CocoaPods.app运行
pod安装

第2步:根据文档

LiveQuery
客户端界面基于订阅的概念。只需在查询上调用
subscribe()
,即可从关联的live query服务器注册任何
PFQuery
实时更新:

let myQuery = Message.query()!.where(....)
let subscription: Subscription<Message> = myQuery.subscribe()
如果卡住,请使用Swift 3示例:

subscription.handleEvent { query, event in
    // Handle event
}