Created
May 6, 2016 03:14
-
-
Save nfarah86/8665b2c67bd2856090dbf3f7e0dc3d68 to your computer and use it in GitHub Desktop.
Update the UI with Current Latitude and Longitude Location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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