WDGPathQuery
代表对一个特定时间段的轨迹进行查询。当一个 WDGPathQuery 实例销毁时,其建立的监听将自动取消。
@property (nonatomic, strong, readonly) NSString *key;要查询的 key。
startTime
Section titled “startTime”@property (nonatomic, strong, readonly) NSDate *startTime;查询时间段的开始时间。
endTime
Section titled “endTime”@property (nonatomic, strong, readonly, nullable) NSDate *endTime;查询时间段的结束时间。如果设置为nil,结束时间为未来无限远。
- observeWithBlock:
Section titled “- observeWithBlock:”- (WilddogHandle)observeWithBlock:(void (^)(WDGPathSnapshot *snapshot))block;对当前查询进行持续监听。
| 参数名 | 说明 |
|---|---|
| block | 查询操作的回调。 |
WilddogHandle实例,代表当前监听的编号,可用于稍后取消监听。
- observeSingleEventWithBlock:
Section titled “- observeSingleEventWithBlock:”- (void)observeSingleEventWithBlock:(void (^)(WDGPathSnapshot *snapshot))block;对当前查询进行单次监听。
| 参数名 | 说明 |
|---|---|
| block | 查询操作的回调,每当路径有变化,将会触发回调。 |
- removeObserverWithHandle:
Section titled “- removeObserverWithHandle:”- (void)removeObserverWithHandle:(WilddogHandle)handle;取消当前查询上的指定监听。
| 参数名 | 说明 |
|---|---|
| handle | 要取消的监听的编号。 |
- removeAllObservers
Section titled “- removeAllObservers”- (void)removeAllObservers;取消当前查询上的所有监听。