Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Last active May 6, 2016 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfarah86/6b2252bd2f7a492a99151a35af0a7658 to your computer and use it in GitHub Desktop.
Save nfarah86/6b2252bd2f7a492a99151a35af0a7658 to your computer and use it in GitHub Desktop.
Get the User's Latitude and Longitude Coordinates Every 10 seconds
// omitted code
- (void)viewDidLoad
{
// omitted code
self.timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(timerDidFire:) userInfo:nil repeats:YES];
}
-(void)timerDidFire: (id)sender
{
NFHLocationManager *locationManager = [NFHLocationManager sharedLocationManager];
if(locationManager.updating) {
CLLocation *location = [locationManager lastLocation];
// omitted 2 lines of code
}
}
// omitted code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment