I have to get the current country in the iPhone settings. Can anyone tell me how to get the current country in iPhone application.
I have to use the current country for parsing the RSS feed in which I need to pass the current country.
Please help me out to find the country .
Thanks in advance.
For devices with SIM card you can use this:
Source Link.
For Swift 4.0,
You can simply use
let countryCode = Locale.current.regionCode
print(countryCode)
Swift 3.0 solution
Swift 3.0 latest working code is
To find the country of the user's chosen language:
In Swift:
If you want to find the country code of the current timezone, see @chings228's answer.
If you want to find the country code of the device's physical location, you will need CoreLocation with reverse geocoding. See this question for detail: How can I get current location from user in iOS