@@ -29,30 +29,24 @@ extension Reactive where Base: CLLocationManager {
29
29
Reactive wrapper for `delegate` message.
30
30
*/
31
31
public var didUpdateLocations : Observable < [ CLLocation ] > {
32
- return delegate. methodInvoked ( #selector( CLLocationManagerDelegate . locationManager ( _: didUpdateLocations: ) ) )
33
- . map { a in
34
- return try castOrThrow ( [ CLLocation ] . self, a [ 1 ] )
35
- }
32
+ return ( delegate as! RxCLLocationManagerDelegateProxy ) . didUpdateLocationsSubject. asObservable ( )
36
33
}
37
34
38
35
/**
39
36
Reactive wrapper for `delegate` message.
40
37
*/
41
- public var didFailWithError : Observable < NSError > {
42
- return delegate. methodInvoked ( #selector( CLLocationManagerDelegate . locationManager ( _: didFailWithError: ) ) )
43
- . map { a in
44
- return try castOrThrow ( NSError . self, a [ 1 ] )
45
- }
38
+ public var didFailWithError : Observable < Error > {
39
+ return ( delegate as! RxCLLocationManagerDelegateProxy ) . didFailWithErrorSubject. asObservable ( )
46
40
}
47
41
48
42
#if os(iOS) || os(macOS)
49
43
/**
50
44
Reactive wrapper for `delegate` message.
51
45
*/
52
- public var didFinishDeferredUpdatesWithError : Observable < NSError ? > {
46
+ public var didFinishDeferredUpdatesWithError : Observable < Error ? > {
53
47
return delegate. methodInvoked ( #selector( CLLocationManagerDelegate . locationManager ( _: didFinishDeferredUpdatesWithError: ) ) )
54
48
. map { a in
55
- return try castOptionalOrThrow ( NSError . self, a [ 1 ] )
49
+ return try castOptionalOrThrow ( Error . self, a [ 1 ] )
56
50
}
57
51
}
58
52
#endif
@@ -118,7 +112,7 @@ extension Reactive where Base: CLLocationManager {
118
112
#endif
119
113
120
114
#if os(iOS) || os(macOS)
121
-
115
+
122
116
/**
123
117
Reactive wrapper for `delegate` message.
124
118
*/
@@ -136,11 +130,11 @@ extension Reactive where Base: CLLocationManager {
136
130
/**
137
131
Reactive wrapper for `delegate` message.
138
132
*/
139
- public var monitoringDidFailForRegionWithError : Observable < ( region: CLRegion ? , error: NSError ) > {
133
+ public var monitoringDidFailForRegionWithError : Observable < ( region: CLRegion ? , error: Error ) > {
140
134
return delegate. methodInvoked ( #selector( CLLocationManagerDelegate . locationManager ( _: monitoringDidFailFor: withError: ) ) )
141
135
. map { a in
142
136
let region = try castOptionalOrThrow ( CLRegion . self, a [ 1 ] )
143
- let error = try castOrThrow ( NSError . self, a [ 2 ] )
137
+ let error = try castOrThrow ( Error . self, a [ 2 ] )
144
138
return ( region: region, error: error)
145
139
}
146
140
}
@@ -176,11 +170,11 @@ extension Reactive where Base: CLLocationManager {
176
170
/**
177
171
Reactive wrapper for `delegate` message.
178
172
*/
179
- public var rangingBeaconsDidFailForRegionWithError : Observable < ( region: CLBeaconRegion , error: NSError ) > {
173
+ public var rangingBeaconsDidFailForRegionWithError : Observable < ( region: CLBeaconRegion , error: Error ) > {
180
174
return delegate. methodInvoked ( #selector( CLLocationManagerDelegate . locationManager ( _: rangingBeaconsDidFailFor: withError: ) ) )
181
175
. map { a in
182
176
let region = try castOrThrow ( CLBeaconRegion . self, a [ 1 ] )
183
- let error = try castOrThrow ( NSError . self, a [ 2 ] )
177
+ let error = try castOrThrow ( Error . self, a [ 2 ] )
184
178
return ( region: region, error: error)
185
179
}
186
180
}
@@ -212,9 +206,6 @@ extension Reactive where Base: CLLocationManager {
212
206
return CLAuthorizationStatus ( rawValue: Int32 ( number. intValue) ) ?? . notDetermined
213
207
}
214
208
}
215
-
216
-
217
-
218
209
}
219
210
220
211
0 commit comments