new update:
I have managed to narrow down the issue: when using .formatted(.measurement(width: .narrow))) to stylize the temperature which is provided from WeatherKit, if the number is smaller than 10, it will somehow forced to shown with one digit behind decimal, like 9.3 or 7.2. If the number is greater than 10 it will just show you the rounded numbers. It has nothing to do with celsius or Fahrenheit nor with civilization I mentioned above. It is just that Fahrenheit usually have two digits and celsius in my region can easily down to below 10 in winter. so basically with mentioned format style you will see digits behind decimal, when temperature lies between -10 to 10 degrees
Thought that I have found the possible problem, but with my fresh swiftui knowledge i still can't solve it properly. Hope you guys would have more ideas.
Post
Replies
Boosts
Views
Activity
I made some more test to observe the differences between locations using celsius as temperature unit on iPhone 14 pro simulator:
when use a location like lat: 25, lon: -70, which is in the middle of ocean and can not be refer to any city, the weather data from WeatherKit will give me perfectly rounded celsius degrees.
When use a location like lat: 40, lon: -90.56, apple suggests this is a place called Rushville and it shows again not rounded celsius degrees.
My guess is if it is near civilization (case Rushville vs Ocean) with much more accurate weather data, WeatherKit tends to give more accurate info, which is intentionally not bad but we don't necessarily need that kind of information. But still I can't find a way around it.
I hope these information could help to address the issue.
I am having this same issue. Followed the Documentation of Apple completely. I even created a new Identifier for my WeatherKit but it's still not working. And yes, Weatherkit in App Services also checked.
My CLLocation is also not nil.
My guess is that this issue is not on our side. Hope this issue could get solved soon