@@ -15,37 +15,42 @@ import CoreLocation
1515extension Reactive where Base: CLLocationManager {
1616 /// Reactive Observable for `activityType`
1717 public var activityType : Observable < CLActivityType ? > {
18- return self . observe ( CLActivityType . self, " activityType " )
18+ return self . observe ( CLActivityType . self, . activityType)
1919 }
2020 /// Reactive Observable for `distanceFilter`
2121 public var distanceFilter : Observable < CLLocationDistance > {
22- return self . observe ( CLLocationDistance . self, " distanceFilter " )
23- . map { $0 ?? 0.0 }
22+ return self . observe ( CLLocationDistance . self, . distanceFilter)
23+ . map { $0 }
24+ . unwrap ( )
2425 }
2526 /// Reactive Observable for `desiredAccuracy`
2627 public var desiredAccuracy : Observable < CLLocationAccuracy > {
27- return self . observe ( CLLocationAccuracy . self, " desiredAccuracy " )
28- . map { $0 ?? 0.0 }
28+ return self . observe ( CLLocationAccuracy . self, . desiredAccuracy)
29+ . map { $0 }
30+ . unwrap ( )
2931 }
3032 /// Reactive Observable for `pausesLocationUpdatesAutomatically`
3133 public var pausesLocationUpdatesAutomatically : Observable < Bool > {
32- return self . observe ( Bool . self, " pausesLocationUpdatesAutomatically " )
33- . map { $0 ?? false }
34+ return self . observe ( Bool . self, . pausesLocationUpdatesAutomatically)
35+ . map { $0 }
36+ . unwrap ( )
3437 }
3538 /// Reactive Observable for `allowsBackgroundLocationUpdates`
3639 public var allowsBackgroundLocationUpdates : Observable < Bool > {
37- return self . observe ( Bool . self, " allowsBackgroundLocationUpdates " )
38- . map { $0 ?? false }
40+ return self . observe ( Bool . self, . allowsBackgroundLocationUpdates)
41+ . map { $0 }
42+ . unwrap ( )
3943 }
4044 /// Reactive Observable for `showsBackgroundLocationIndicator`
4145 public var showsBackgroundLocationIndicator : Observable < Bool > {
42- return self . observe ( Bool . self, " showsBackgroundLocationIndicator " )
43- . map { $0 ?? false }
46+ return self . observe ( Bool . self, . showsBackgroundLocationIndicator)
47+ . map { $0 }
48+ . unwrap ( )
4449 }
4550 /// Reactive Observable for `location`
4651 public var location : Observable < CLLocation ? > {
4752 let updatedLocation = self . didUpdateLocations. map { $1. last }
48- let location = self . observe ( CLLocation . self, " location " )
53+ let location = self . observe ( CLLocation . self, . location)
4954 return Observable . of ( location, updatedLocation) . merge ( )
5055 }
5156 /// Reactive Observable for CLPlacemark
@@ -67,33 +72,37 @@ extension Reactive where Base: CLLocationManager {
6772 }
6873 /// Reactive Observable for `headingFilter`
6974 public var headingFilter : Observable < CLLocationDegrees > {
70- return self . observe ( CLLocationDegrees . self, " headingFilter " )
71- . map { $0 ?? 0.0 }
75+ return self . observe ( CLLocationDegrees . self, . headingFilter)
76+ . map { $0 }
77+ . unwrap ( )
7278 }
7379 /// Reactive Observable for `headingOrientation`
7480 public var headingOrientation : Observable < CLDeviceOrientation ? > {
75- return self . observe ( CLDeviceOrientation . self, " headingOrientation " )
81+ return self . observe ( CLDeviceOrientation . self, . headingOrientation)
7682 }
7783 #if os(iOS) || os(macOS)
7884 /// Reactive Observable for `heading`
7985 public var heading : Observable < CLHeading ? > {
80- return self . observe ( CLHeading . self, " heading " )
86+ return self . observe ( CLHeading . self, . heading)
8187 }
8288 #endif
8389 /// Reactive Observable for `maximumRegionMonitoringDistance`
8490 public var maximumRegionMonitoringDistance : Observable < CLLocationDistance > {
85- return self . observe ( CLLocationDistance . self, " maximumRegionMonitoringDistance " )
86- . map { $0 ?? 0.0 }
91+ return self . observe ( CLLocationDistance . self, . maximumRegionMonitoringDistance)
92+ . map { $0 }
93+ . unwrap ( )
8794 }
8895 /// Reactive Observable for `monitoredRegions`
8996 public var monitoredRegions : Observable < Set < CLRegion > > {
90- return self . observe ( Set< CLRegion> . self , " monitoredRegions " )
91- . map { $0 ?? [ ] }
97+ return self . observe ( Set< CLRegion> . self , . monitoredRegions)
98+ . map { $0 }
99+ . unwrap ( )
92100 }
93101 /// Reactive Observable for `rangedRegions`
94102 public var rangedRegions : Observable < Set < CLRegion > > {
95- return self . observe ( Set< CLRegion> . self , " rangedRegions " )
96- . map { $0 ?? [ ] }
103+ return self . observe ( Set< CLRegion> . self , . rangedRegions)
104+ . map { $0 }
105+ . unwrap ( )
97106 }
98107
99108 /// Reactive Observable for `locationServicesEnabled`
@@ -190,4 +199,4 @@ extension CLLocationManager {
190199 }
191200 }
192201 #endif
193- }
202+ }
0 commit comments