Post

Replies

Boosts

Views

Activity

Reply to WeatherKit UV index is always returning 0
Ok so i've made a few changes to the code to use the real location and change it on the simulator level + use .current WeatherQuery to fetch weather : func fetchUVIndex(location: Location) async throws -> Int {     let clLocation = CLLocation(latitude: location.latitude, longitude: location.longitude)     let weather = try? await self.weatherService.weather(for: clLocation, including: .current)     guard let weather else { throw UVError.noWeatherAvailable }     return weather.uvIndex.value } Now it's working fine and returning the correct value
Jul ’22