【发布时间】:2017-06-10 13:55:18
【问题描述】:
我正在尝试观察我的UserDefaults 以监控locations 的变化,这是CLLocationCoordinate2D 的数组。
这是我正在尝试的:
extension UserDefaults {
var ob: Observable<[CLLocationCoordinate2D]> {
return self.rx.observe(Array.self, "locations")
}
}
但我收到此错误:
no 'observe' candidates produce the expected contextual result type 'Observable<[CLLocationCoordinate2D]>' (aka 'Observable<Array<CLLocationCoordinate2D>>
有什么想法吗?谢谢!
【问题讨论】:
标签: arrays swift nsuserdefaults rx-swift