How do I know which is the default measure system (imperial or metric) on iOS?

前端 未结 6 1448
旧时难觅i
旧时难觅i 2020-12-07 22:15

How do I know which is the default measure system (imperial or metric) on iOS ?

How do I get this preference from the device settings, so I know what to display in m

6条回答
  •  时光取名叫无心
    2020-12-07 22:59

    @DarkDust answer for swift3

    //User region setting return
    let locale = Locale.current //NSLocale.current
    
    //Returns true if the locale uses the metric system 
    let isMetric = locale.usesMetricSystem
    

提交回复
热议问题