
Weatherkit
Wire Apple WeatherKit into a SwiftUI iOS app with forecasts, alerts, charts, and location-aware fetching.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill weatherkitWhat is this skill?
- @Observable @MainActor WeatherManager fetching current, hourly, daily, and alerts in one async call
- SwiftUI-ready patterns for binding forecast and attribution state
- Charts integration for hourly and daily weather visualization
- Historical weather statistics and weather condition mapping helpers
- Caching strategy and location-based weather fetch flows
Adoption & trust: 1.6k installs on skills.sh; 713 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Vercel React Native Skillsvercel-labs/agent-skills
Firebase Basicsfirebase/agent-skills
Building Native Uiexpo/skills
Firebase Ai Logic Basicsfirebase/agent-skills
Native Data Fetchingexpo/skills
Firebase Firestorefirebase/agent-skills
Journey fit
Primary fit
WeatherKit is implemented while building the product—entitlements, async service calls, and UI—not during idea research or post-launch growth alone. The skill centers on integrating Apple's WeatherKit service with CoreLocation and SwiftUI, which maps to build → integrations on the Prism shelf.
Common Questions / FAQ
Is Weatherkit safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Weatherkit
# WeatherKit Extended Patterns Overflow reference for the `weatherkit` skill. Contains advanced patterns that exceed the main skill file's scope. ## Contents - [WeatherKit SwiftUI Integration](#weatherkit-swiftui-integration) - [Charts Integration](#charts-integration) - [Historical Weather Statistics](#historical-weather-statistics) - [Weather Condition Mapping](#weather-condition-mapping) - [Caching Strategy](#caching-strategy) - [Location-Based Weather](#location-based-weather) ## WeatherKit SwiftUI Integration ### Weather Manager with `@Observable` ```swift import WeatherKit import CoreLocation @Observable @MainActor final class WeatherManager { private let service = WeatherService.shared var current: CurrentWeather? var hourlyForecast: Forecast<HourWeather>? var dailyForecast: Forecast<DayWeather>? var alerts: [WeatherAlert]? var attribution: WeatherAttribution? var isLoading = false var error: Error? func fetchWeather(for location: CLLocation) async { isLoading = true error = nil do { let (current, hourly, daily, alerts) = try await service.weather( for: location, including: .current, .hourly, .daily, .alerts ) self.current = current self.hourlyForecast = hourly self.dailyForecast = daily self.alerts = alerts self.attribution = try await service.attribution } catch { self.error = error } isLoading = false } } ``` ### Weather Dashboard View ```swift import SwiftUI import WeatherKit struct WeatherDashboardView: View { @Environment(WeatherManager.self) private var manager let location: CLLocation var body: some View { NavigationStack { ScrollView { VStack { if manager.isLoading { ProgressView("Loading weather...") } else if let current = manager.current { currentConditionsCard(current) } if let hourly = manager.hourlyForecast { hourlyForecastSection(hourly) } if let daily = manager.dailyForecast { dailyForecastSection(daily) } if let alerts = manager.alerts, !alerts.isEmpty { alertsSection(alerts) } if let attribution = manager.attribution { WeatherAttributionView(attribution: attribution) } } .padding() } .navigationTitle("Weather") .task { await manager.fetchWeather(for: location) } .refreshable { await manager.fetchWeather(for: location) } } } private func currentConditionsCard(_ current: CurrentWeather) -> some View { VStack { Image(systemName: current.symbolName) .font(.system(size: 60)) .symbolRenderingMode(.multicolor) Text(current.temperature.formatted()) .font(.system(size: 48, weight: .thin)) Text(current.condition.description) .font(.title3) .foregroundStyle(.secondary) HStack { Label( "Humidity \(current.humidity.formatted(.percent))", systemImage: "humidity" ) Label( "Wind \(current.wind.speed.formatted())", systemImage: "wind" ) Label( "UV \(current.uvIndex.value)", systemImage: "sun.max" ) } .font(.caption) } .padding() } privat