1 |
|
2 |
|
3 | #import <CoreLocation/CLHeading.h>
|
4 | #import <CoreLocation/CLLocation.h>
|
5 | #import <CoreLocation/CLLocationManager.h>
|
6 | #import <CoreLocation/CLLocationManagerDelegate.h>
|
7 |
|
8 | NS_ASSUME_NONNULL_BEGIN
|
9 |
|
10 | @interface EXLocationDelegate : NSObject <CLLocationManagerDelegate>
|
11 |
|
12 | @property (nonatomic, strong) NSNumber *watchId;
|
13 | @property (nonatomic, strong) CLLocationManager *locMgr;
|
14 | @property (nonatomic, strong) void (^onUpdateLocations)(NSArray<CLLocation *> *locations);
|
15 | @property (nonatomic, strong) void (^onUpdateHeadings)(CLHeading *newHeading);
|
16 | @property (nonatomic, strong) void (^onError)(NSError *error);
|
17 |
|
18 | - (instancetype)initWithId:(nullable NSNumber *)watchId
|
19 | withLocMgr:(CLLocationManager *)locMgr
|
20 | onUpdateLocations:(nullable void (^)(NSArray<CLLocation *> *locations))onUpdateLocations
|
21 | onUpdateHeadings:(nullable void (^)(CLHeading *newHeading))onUpdateHeadings
|
22 | onError:(nullable void (^)(NSError *error))onError;
|
23 |
|
24 | - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations;
|
25 |
|
26 | - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading;
|
27 |
|
28 | - (void)locationManager:(CLLocationManager *)manager didFailWithError:(nonnull NSError *)error;
|
29 |
|
30 | @end
|
31 |
|
32 | NS_ASSUME_NONNULL_END
|