You can use CLLocationManager
to get your current position , and after that you can do reverse geocoding
to get the address from the coordinates.
In that address, if it's accurate you'll find the word 'London
' to match your needs.
Do this in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
:
CLLocationManager *manager = [[CLLocationManager alloc] init];
manager.delegate = self;
//Here you set the Distance Filter that you need
manager.distanceFilter = kCLDistanceFilterNone;
// Here you set the Accuracy
manager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
[manager startUpdatingLocation];
And in the delegate function:
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) {
//Picked the first placemark
CLPlacemark *placemark = placemarks[0];
//you can play and see how to grab the key name that you want.
NSLog(@"Address %@",[NSString stringWithFormat:@"%@ %@",placemark.thoroughfare,addressNumber]);
//Do your additional setup here
}];
[geocoder release];
[location release];
}
And if you want to delay the loading so you can get the time to grab all of the info then you can present another viewcontroller
which has the splash screen
on it and do the checking there/or in the appDelegate
.