Reputation: 4061
Is there a way to find out the users location Continent? I need to set an AWS entry point based on if they open the app in the US, or Europe. etc.
Is there a way to do this without taking GPS coordinates and making ranges out of them?
Upvotes: 1
Views: 459
Reputation: 1426
Although a CLPlacemark object contains lots of useful information, its corresponding continent is not present on it.
I wrote a small category to add a -continent method that returns the corresponding string of the continent based on the -ISOCountryCode of a CLPlacemark.
https://github.com/Hecktorzr/Transcontinental
Upvotes: 0
Reputation: 20410
If you are in iOS5, you can use GLGeocoder to retrieve the information abotu a current location:
[self.CLGeocoder reverseGeocodeLocation: locationManager.location completionHandler:
^(NSArray *placemarks, NSError *error) {
CLPlacemark *placemark = [placemarks objectAtIndex:0];
//placemark contains the address
}];
CLPlacemark reference:
GLGeocoder reference:
Upvotes: 2
Reputation: 11174
you can reverse geocode a location and get details of where the user is located in text. You use the reverseGeocodeLocation:completionHandler:
method on the CLGeocoder class to do this
The completion handler in this method gets passed in an array of CLPlacemark
objects, which contain the country code, which you can use to determine the users continent
Upvotes: 2