【发布时间】:2019-06-10 20:22:20
【问题描述】:
尝试使用 swiftUI 获取当前位置。下面的代码,无法使用 didUpdateLocations 委托进行初始化。
class GetLocation : BindableObject {
var didChange = PassthroughSubject<GetLocation,Never>()
var location : CLLocation {
didSet {
didChange.send(self)
}
}
init() {}
}
【问题讨论】:
-
为什么你不能在这个类中创建 CLLocationManager?
标签: swift xcode swiftui cllocation