Use capture list
This commit is contained in:
parent
698a50b381
commit
2b2f416820
|
|
@ -26,13 +26,12 @@ class GeolocationService {
|
|||
locationManager.distanceFilter = kCLDistanceFilterNone;
|
||||
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
|
||||
|
||||
weak var weakLocationManager = self.locationManager
|
||||
autorized = Observable.deferred {
|
||||
autorized = Observable.deferred { [weak locationManager] in
|
||||
let status = CLLocationManager.authorizationStatus()
|
||||
guard let strongLocationManager = weakLocationManager else {
|
||||
guard let locationManager = locationManager else {
|
||||
return Observable.just(status)
|
||||
}
|
||||
return strongLocationManager
|
||||
return locationManager
|
||||
.rx_didChangeAuthorizationStatus
|
||||
.startWith(status)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue