This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

33 lines
1.3 KiB
Objective-C

// Copyright 2015-present 650 Industries. All rights reserved.
#import <CoreLocation/CLHeading.h>
#import <CoreLocation/CLLocation.h>
#import <CoreLocation/CLLocationManager.h>
#import <CoreLocation/CLLocationManagerDelegate.h>
NS_ASSUME_NONNULL_BEGIN
@interface EXLocationDelegate : NSObject <CLLocationManagerDelegate>
@property (nonatomic, strong) NSNumber *watchId;
@property (nonatomic, strong) CLLocationManager *locMgr;
@property (nonatomic, strong) void (^onUpdateLocations)(NSArray<CLLocation *> *locations);
@property (nonatomic, strong) void (^onUpdateHeadings)(CLHeading *newHeading);
@property (nonatomic, strong) void (^onError)(NSError *error);
- (instancetype)initWithId:(nullable NSNumber *)watchId
withLocMgr:(CLLocationManager *)locMgr
onUpdateLocations:(nullable void (^)(NSArray<CLLocation *> *locations))onUpdateLocations
onUpdateHeadings:(nullable void (^)(CLHeading *newHeading))onUpdateHeadings
onError:(nullable void (^)(NSError *error))onError;
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations;
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading;
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(nonnull NSError *)error;
@end
NS_ASSUME_NONNULL_END