Skip to content

Instantly share code, notes, and snippets.

@petermolnar-dev
Created June 28, 2022 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petermolnar-dev/f59e8073de7d281081ee25dfeef0ec56 to your computer and use it in GitHub Desktop.
Save petermolnar-dev/f59e8073de7d281081ee25dfeef0ec56 to your computer and use it in GitHub Desktop.
Detect the country without geolocation, from the Contacts framework
import Contacts
class CountryDetector {
func detectCountryWithoutLocation() -> String {
CNContactsUserDefaults.shared().countryCode
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment