From 2b2f4168208e747d22419f4fb01c012e28018d7f Mon Sep 17 00:00:00 2001 From: kitasuke Date: Sun, 13 Mar 2016 14:07:28 -0700 Subject: [PATCH] Use capture list --- RxExample/RxExample/Services/GeolocationService.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/RxExample/RxExample/Services/GeolocationService.swift b/RxExample/RxExample/Services/GeolocationService.swift index 761a81c0..083400ba 100644 --- a/RxExample/RxExample/Services/GeolocationService.swift +++ b/RxExample/RxExample/Services/GeolocationService.swift @@ -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) }