#WeatherKit

François-Olivier Leblancf_o@iosdev.space
2024-10-19

Let's say I have a class that interacts with #WeatherKit in #swiftlang
I would like to test that class using mocks.
Now I have already added a protocol that mimics WK's WeatherService and added compliance to it: so now my WeatherService dependency can be mocked.
But the function I need returns a Weather modem and I can't figure out how to create Weather mock objects: the init is not public, except the (from: decoder) one.
What am I missing?

#unittests #iosdev

Miroslav Buček 🌳miroslavbucek@mastodonczech.cz
2024-08-20

Na oficiálním fóru taky ticho po pěšině.

#Apple #WeatherKit

Miroslav Buček 🌳miroslavbucek@mastodonczech.cz
2024-08-20

#Apple měl dnes výpadek u své placené služby #WeatherKit plných 16 hodin. To je až nepochopitelné. Píše se o tom někde? Budeme muset přidat do integrací tuto alternativu a počítat s 24 hodinovým výpadkem.

Chris Wu :cwy:MuseumShuffle
2024-07-22

Had a talk with my mentors at @mercury this weekend and as usual they helped me understand. The fact that WeatherKit is returning iOS 18 monthlyStatistics() that do not match the location I asked for might be ok because it's still close to what location I'm asking for.

In my small samples it seems to be approx within 45-55m.

Since there's no mention of this in the docs I don't know how far away is too far. Right now I'm going with less than 100m.

Updated FB14326476 about this.

Chris Wu :cwy:MuseumShuffle
2024-07-09

I've got a theory that WeatherKit was enhanced for iOS 17 users with the recent additions for iOS 18 that we're now testing.

I'm adding some new features to the iOS 17 version of Please Don't Rain and just realized that I'm seeing sleet on my precipitation chart. I have NEVER seen that before. It's only been rain and snow returned (and I have looked at a LOT of forecasts).

I felt like a proud papa watching his kid handle a new situation appropriately. 🥹

Please Don't Rain precipitation chart showing snow, sleet, and rain.
Chris Wu :cwy:MuseumShuffle
2024-07-03

I hit an issue with the new HistoricalComparisons that can be returned with WeatherKit in iOS 18.

In this code the print statement can show the contents just fine. If you try the same thing with Logger it won't compile and gives the error: "failed to produce a diagnostic for expression".

It will compile if you use String(describing:), but the user isn’t given any indication that will fix it in the error message. I had to figure it out on my own.

Filed FB14174429

let foundHistory : HistoricalComparisons? = foundAllForecasts.4
let logitBlah = Logger(subsystem: AppConstants.BundleID, category: "GetUserInfo")
if let foundHistory {
  print("blah \(foundHistory)")
  logitBlah.debug("before history")
  // won't compile!!!
  logitBlah.debug("history \(foundHistory)")
  // will compile
  logitBlah.debug("history \(String(describing: foundHistory))")
}
Thinkbitz Appsthinkbitz
2024-06-19

I've noticed an elevated number of connection failures to WeatherKit, and I'm attempting to engage with Apple to get them fixed. Apologies if the app isn't updating, hopefully this will get resolved soon. (FB13965841)

Axel Le Pennecalpennec@iosdev.space
2024-06-17

Now, this is the first version of the app, I have tons of ideas to improve it but I wanted to get it in people's hands and see what people like, what they want, and how it's used 🙂

On the technical side, the app is entirely built in #SwiftUI (what did you expect?), and leverages #CoreLocation, #MapKit, #WeatherKit and a little bit of #SwiftCharts.

This app is the reason I filed and share many feedback related to these frameworks lately 😄

#iOS #AppStore #IndieDev

Stewart Lynch 🇨🇦StewartLynch@iosdev.space
2024-06-05

The #SwiftUI series on building a full #WeatherKit app is complete.
In this video we create functions to encode and decode our list and as JSON stored in app Documents Directory.
youtu.be/bW52ZSOGWek
Full Series: youtube.com/playlist?list=PLBn

Stewart Lynch 🇨🇦StewartLynch@iosdev.space
2024-06-02

This is the 6th video in a 7 part series on building a #SwiftUI app using #WeatherKit.
In this video I am going to show you how you can use the CoreLocation and MapKit frameworks to search for and add cities by name. Final persistence video on Wednesday.
youtu.be/puelrPxXj-8

Stewart Lynch 🇨🇦StewartLynch@iosdev.space
2024-05-29

This is the 5th video in a 7 Part series on building a full #SwiftUI weather app using #WeatherKit.
In this video we will be adding the final forecast type and that is a 10 day daily forecast.

youtu.be/33AdLX2GU2c
Full Playlist is: youtube.com/playlist?list=PLBn

Stewart Lynch 🇨🇦StewartLynch@iosdev.space
2024-05-26

I am moving up my release schedule for my 7 part #SwiftUI #WeatherKit series. Here are the latest two in the series.
Make your app shine with dynamic backgrounds hourly forecast and an updated UI.

Video 3: youtu.be/oCJRZJ_Kb4s
Video 4: youtu.be/jgmkbRGgKxM

Stewart Lynch 🇨🇦StewartLynch@iosdev.space
2024-05-22

The 2nd video in the 7 part #SwiftUI #WeatherKit series is now available.

In this video we will introduce locationManager so that the app will be able to determine your current location and display the weather for that location when the app launches.

youtu.be/bl_0hNyoeWs

Stewart Lynch 🇨🇦StewartLynch@iosdev.space
2024-05-19

The first video of the new 7 part #SwiftUI video on #WeatherKit is now available. All 7 will be released before WWDC. Next one comes on Wednesday.
Buy me a ko-fi and get access to all 7 now (ko-fi.com/StewarLynch)
youtu.be/8qz1LxtM7aI

Stewart Lynch 🇨🇦StewartLynch@iosdev.space
2024-05-09

Brand new, free 7 part #SwiftUI #WeatherKit series coming to my YouTube Channel starting May 19. Buy me a Ko-fi now and get immediate access to entire series. My monthly subscribers already have it.

ko-fi.com/stewartlynch
youtube.com/@StewartLynch

Chris Wu :cwy:MuseumShuffle
2024-04-17

Regarding the issue I noticed with Apple WeatherKit not returning a 10 day forecast sometimes, @kaidombrowski mentioned that he's seen this recently also and pointed out that you can see this reflected in the Apple Weather app.

Sure enough, at 7:30AM CDT it shows a "daily forecast" with 9 days for Rosemont IL. But at 10AM CDT it shows a "10 day forecast" with 10 days.

left side is a "daily forecast" with 9 days. right side is a "10 day forecast" with 10 days.
Chris Wu :cwy:MuseumShuffle
2024-04-16

I'm now thinking that the problem I'm seeing with WeatherKit not returning weather for 10 days might be based on what time of the day it currently is.

I couldn't recreate it yesterday afternoon. Woke up this morning and could easily recreate it. Waited two hours and it's not happening again.

With the same start and end time in Chicago when I made a request around 8am EDT it returned 10 days of hourly info but only 9 days of daily info. Around 10am EDT it returns 10 days of both.

Asking for weather from April 16 to 25. Got back daily forecasts for April 16 to 24.Asking for weather from April 16 to 25. Got back daily forecasts for April 16 to 25.
Chris Wu :cwy:MuseumShuffle
2024-04-15

The images attached show the last daily info returned as April 23 but also as April 24 in another attempt for the same city for the same dates. I did both of these attempts between just now (nowhere near midnight CDT) so there should be no difference in what is returned.

Filed FB13730365

2/2

@malin @kaidombrowski @joehribar @alpennec

Weather data that ends with daily info for April 23.Weather data that ends with daily info for April 24.
Cihat GündüzJeehut@iosdev.space
2024-03-01

What if @Apple provides an API for the data of the new #AppleSports app to developers at #WWDC? 🤔

They did the same thing with #WeatherKit in 2022, pricing was fair even for Indies. Imagine what kind of apps we could build! ⛹️‍♀️

This could especially shine on #AppleVisionPro. ✨

Chris Wu :cwy:MuseumShuffle
2024-01-07

So I did a deep dive into the raw data I'm getting from WeatherKit.

The precipitationAmount for the snow for the hour lined up with what I'm reporting in my app.

But WAIT. My eye spotted that there's a "snowfallAmount" property. And these values are matching up to what the iOS weather app is showing for snow for the hours in question!

🧵

WeatherKit.HourWeather(date: 2024-01-09 15:00:00 +0000, cloudCover: 0.98, cloudCoverLow: 0.0, cloudCoverMid: 0.0, cloudCoverHigh: 0.0, condition: Heavy Snow, symbolName: "cloud.snow", dewPoint: -0.44 °C, humidity: 0.96, isDaylight: true, precipitation: snow, precipitationChance: 0.61, precipitationAmount: 2.75 mm, snowfallAmount: 27.16 mm, pressure: 1018.33 mbar, pressureTrend: Falling, temperature: 0.16 °C, apparentTemperature: -4.72 °C, uvIndex: WeatherKit.UVIndex(value: 1, category: Low), visibility: 778.16 m, wind: WeatherKit.Wind(compassDirection: Southeast, direction: 127.0 °, speed: 17.97 km/h, gust: Optional(51.98 km/h))),

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst