Fetch WeatherKit current, minute, hourly, and daily forecasts; weather alerts; iOS 18+ changes, historical comparisons, summaries, and statistics; and required Apple Weather attribution. Use when integrating weather data, showing forecasts or alerts, caching WeatherKit responses, displaying attribution, or reviewing WeatherKit query limits in iOS apps.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fetch current conditions, hourly and daily forecasts, weather alerts, and historical statistics using WeatherService. Displays mandatory Apple Weather attribution.
NSLocationWhenInUseUsageDescription to Info.plist if requesting coordinates via CoreLocation.WeatherService.shared across the app.Fetch complete weather datasets for a target CLLocation:
import WeatherKit
import CoreLocation
let weather = try await WeatherService.shared.weather(for: location)
// Current conditions
let current = weather.currentWeather
print("Temperature: \(current.temperature.formatted())")
print("Condition: \(current.condition.description), SF Symbol: \(current.symbolName)")
// Hourly and Daily forecasts
for hour in weather.hourlyForecast.prefix(12) {
print("\(hour.date.formatted(date: .omitted, time: .shortened)): \(hour.temperature.formatted())")
}Format Measurement<UnitTemperature> values with .formatted() to honor user locale conventions.
Reduce bandwidth and processing by requesting only necessary datasets:
let (current, hourly) = try await WeatherService.shared.weather(
for: location,
including: .current, .hourly
)Available query types include .current, .hourly, .daily, .minute, and .alerts.
Access climate context, historical comparisons, and weather summaries:
// Query weather changes (e.g. temperature shift since yesterday)
let changes = try await WeatherService.shared.weather(for: location, including: .changes)
// Historical comparison
let historical = try await WeatherService.shared.weather(for: location, including: .historicalComparisons)Apple requires visible attribution whenever WeatherKit data is displayed:
let attribution = try await WeatherService.shared.attribution
// Display attribution.combinedMark (light/dark Apple Weather logo)
// Provide tappable link to attribution.legalPageURLIn SwiftUI, display attribution using Link and the official logo asset.
metadata.expirationDate returned with forecasts; avoid refetching unexpired data.weather(for:) on every view appearance causes rate-limiting errors. Respect metadata.expirationDate.temperature.formatted().including: queries.Measurement.formatted()including:) used to minimize network payloadmetadata.expirationDatethienqo/ios-skills
6bf8b62
Canonical home
since May 23, 2026
Also appears in
on Sep 6, 2026
since May 22, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.