WeatherKit not showing Temp Correctly on device

Hi, I'm in the process of developing a weather app using WeatherKit. Everything seems to be working fine in the Simulator, but when I put it on the device (iPhone 13 Pro Max) the temperature displays wrong.

Example:

On Simulator: 34 F

On Device: 34.98 F

Anyone else have this problem?

Dan Uff

Replies

, wrong location?

you might have a different coordinate on your simulator and your actual device

  • No, everything seems to be correct on the simulator and device.

Add a Comment

Hi.. I also ran into this issue with SwiftUI and the iOS 16 SDK, and the fix was to specify the format. At that time just calling out the measurement width to be narrow, resolved the issue. But... It came up again with iOS 17 SDK. Below is an example of what I did to fix the issue. The main thing is to look at how the format for measurement is configured.

weather.currentWeather.temperature.formatted(.measurement(width: .narrow, usage: .weather, numberFormatStyle: .number.precision(.fractionLength(0)))))