Post

Replies

Boosts

Views

Activity

WeatherKit Temperature Celsius
Hello everyone, with Weatherkit I want to display the current Temperature using the system temperature unit setting. Text(weather.currentWeather.temperature.formatted(.measurement(width: .narrow))) I have two problems with this code: I ran my code on different simulators: iPhone 14 Pro, iPhone 14 pro max and iPhone 13 Pro Max. On the first simulator it shows a temperature with only number and degree, like 34º, which it supposed to be. But on other two simulators it is shown as 34ºF (system temperature unit set to Fahrenheit). On my actual device it shows again 34º. That makes me very confused. If changed system unit to celsius, the celsius degrees are not rounded, they are like 3,9ºC or 12,3ºC. This is very strange because if its Fahrenheit they are again rounded. With .measurement(width:.narrow) shouldn't they all work under same condition like rounded or not? or can someone help me how can I have this settings work systematically as it should be?
4
0
1.4k
Feb ’23