24 [
self setupLocationManager];
47 if ([
_locationManager respondsToSelector:
@selector(requestWhenInUseAuthorization)])
49 [_locationManager requestWhenInUseAuthorization];
61 [_locationManager startUpdatingLocation];
63 printf(
"Starting Location Manager\n");
74 [_locationManager stopUpdatingLocation];
76 printf(
"Stopping Location Manager\n");
80 - (
void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation
85 if (newLocation.horizontalAccuracy > 0.0)
90 _updateCB(newLocation.coordinate.latitude,
91 newLocation.coordinate.longitude,
93 newLocation.horizontalAccuracy);
98 - (
void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error
104 if ([error code] != kCLErrorLocationUnknown)
106 printf(
"**** locationManager didFailWithError ****\n");
111 - (
void)locationManager:(CLLocationManager*)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
114 if (status == kCLAuthorizationStatusAuthorizedAlways ||
115 status == kCLAuthorizationStatusAuthorizedWhenInUse)
123 _permissionCB(
false);
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
CLLocationManager * _locationManager
void stop()
Stops the location data update.
BOOL start()
Starts the location data update.
void setupLocationManager()
Starts the location data update if the interval time > 0 else it stops.