尝试使用SwiftUI获取当前位置。以下代码,无法使用didUpdateLocations代理进行初始化。
class GetLocation : BindableObject {
var didChange = PassthroughSubject<GetLocation,Never>()
var location : CLLocation {
didSet {
didChange.send(self)
}
}
init() {}
}