forked from anr2me/ppsspp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocationHelper.mm
34 lines (27 loc) · 879 Bytes
/
LocationHelper.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#import "LocationHelper.h"
@interface LocationHelper()
@end
@implementation LocationHelper
-(id) init {
NSLog(@"LocationHelper::init");
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
return self;
}
-(void) startLocationUpdates {
NSLog(@"LocationHelper::startLocationUpdates");
if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[locationManager requestWhenInUseAuthorization];
}
[locationManager startUpdatingLocation];
}
-(void) stopLocationUpdates {
NSLog(@"LocationHelper::stopLocationUpdates");
[locationManager stopUpdatingLocation];
}
- (void) locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations {
for (id location in locations) {
[self.delegate SetGpsDataIOS:location];
}
}
@end