Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 6, 2016 03:14
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/8665b2c67bd2856090dbf3f7e0dc3d68 to your computer and use it in GitHub Desktop.
Save nfarah86/8665b2c67bd2856090dbf3f7e0dc3d68 to your computer and use it in GitHub Desktop.
Update the UI with Current Latitude and Longitude Location
// omitted code
- (void)updateInterfaceWithLocation:(CLLocation *)lastLocation {
// we update the UILabel with the longitude and latitude values
self.latitude.text = [NSString stringWithFormat:@"%f",lastLocation.coordinate.latitude];
self.longitude.text = [NSString stringWithFormat:@"%f",lastLocation.coordinate.longitude];
}
// omitted code
- (IBAction)buttonPress:(id)sender {
CLLocation *lastLocation = [NFHLocationManager sharedLocationManager].lastLocation;
// omitted 1 line of code - it's not important for our purposes here
[self updateInterfaceWithLocation:lastLocation];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment