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

前端 未结 6 1453
旧时难觅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条回答
  •  Happy的楠姐
    2020-12-07 23:01

    here's a swift version

    var locale = NSLocale.currentLocale()
    let isMetric = locale.objectForKey(NSLocaleUsesMetricSystem) as! Bool
    

提交回复
热议问题