Find current country from iPhone device

前端 未结 9 966
醉话见心
醉话见心 2020-12-04 08:38

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

9条回答
  •  自闭症患者
    2020-12-04 09:06

    For Swift 4.0,

    You can simply use

    let countryCode = Locale.current.regionCode

    print(countryCode)

提交回复
热议问题