-4

I would like to check if the user's country is in India. How can I do that in Swift? What library can I use do accomplish this task? I want to do this to display different prices for India users as a test.

I think I figured it out. Is it NSLocale.current.regionCode. Is so what's the code for India?

Rue Vitale
  • 1,549
  • 4
  • 17
  • 24
  • It could help you https://stackoverflow.com/questions/3940615/find-current-country-from-iphone-device/8357916 – Eric Jan 12 '21 at 17:00
  • Checking whether user is a specific country is always implemented by sending a request and checking the IP address. – Sulthan Jan 12 '21 at 18:24

1 Answers1

0

I don't know much about Swift, but I think this might help:

To get a user's current location, you'll first need to import MapKit and CoreLocation in the top of your view controller. You will have to decide whether your application will need the users location always (even when in it's in the background) or only when the apps in use.

-How to get Current Location in Swift