Showing Weather forecast using SwiftUI + Async.
Select a area, and show daily forecasts, using WeatherKit
- SwiftUI.framework
- Swift6 Support
- Using
LocationButton
, which are new APIs in iOS 15. - MKMapView with CoreLocation
- GPS with async/await
- detect tap and add pin at tap position
- Adapt dark mode with asset-catalog-colors
- Use
WeatherKit
- Install Xcode16.0 or later
- Build and Run
By default, this app will access local-json file.
If you want to use network-api, please do as following
- sign in OpenWeather and create Api Key
- rename
Config-sample.plist
toConfig.plist
- Write your Api Key in
Constants.plist
city_list.json from Openweather is too big (20MB!). So I shrinked it. Please check city_json/
To run devices, you need to set up your project as follows.
https://developer.apple.com/documentation/weatherkit/fetching_weather_forecasts_with_weatherkit
- /
+- RootView.swift : view at app-launching
+- Theme.swift : Color list
+- asset/ : cities and sample json
+- Actions/ : side-effects
+- CommonView/ : common views
+- Utils/
+- View/
- Simplify structure, no view-models
Actions/
has complex side-effect operations with@Environment
- OpenWeather
- Many repositories using SwiftUI and authors.