weatherkit
Fetch current, hourly, and daily weather forecasts and display required attribution using WeatherKit. Use when integrating weather data, showing forecasts, handling weather alerts, displaying Apple Weather attribution, or querying historical weather statistics in iOS apps.
Security Assessment
About weatherkit
The WeatherKit skill enables iOS developers to integrate Apple's weather data service into their applications. It provides a comprehensive interface for fetching current weather conditions, hourly and daily forecasts, weather alerts, and historical statistics using the WeatherService API. This skill addresses the need for reliable, accurate weather data in iOS apps while ensuring compliance with Apple's attribution requirements.
The skill offers access to detailed weather information including temperature, humidity, wind conditions, UV index, precipitation chances, and weather condition symbols. It supports flexible querying with custom date ranges for forecasts, selective data fetching to optimize performance and reduce data usage, and handles weather alerts with severity levels. The service is thread-safe and uses Swift's modern concurrency model with async/await.
This skill is designed for iOS developers building weather-dependent applications such as travel apps, outdoor activity planners, agriculture tools, or any app requiring location-based weather context. It requires Swift 6.3 and iOS 26+, an active Apple Developer Program membership, and proper WeatherKit capability configuration in Xcode. The skill includes guidance on setup, data fetching patterns, attribution requirements, and common implementation pitfalls to avoid.
FAQ
What are the requirements to use WeatherKit in my iOS app?
You need Swift 6.3 or later targeting iOS 26+, an active Apple Developer Program membership, the WeatherKit capability enabled in Xcode and your App ID, and NSLocationWhenInUseUsageDescription in Info.plist if using device location.
How many hours and days of forecast data can I fetch?
By default, WeatherKit provides 25 contiguous hours for hourly forecasts starting from the current hour, and 10 contiguous days for daily forecasts starting from the current day. You can also request custom date ranges using WeatherQuery.
Is Apple Weather attribution required when using WeatherKit?
Yes, Apple requires displaying proper attribution when using WeatherKit data. The skill includes guidance on how to display the required Apple Weather attribution in your app.
Can I fetch only specific weather data to reduce bandwidth?
Yes, WeatherKit supports selective queries where you can request only the specific datasets you need (current weather, hourly forecast, daily forecast, or alerts) rather than fetching all data at once.
Is WeatherService thread-safe for concurrent use?
Yes, WeatherService is Sendable and thread-safe. You can use the shared singleton or create your own instance and safely call it from multiple concurrent contexts.
Install weatherkit
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
dpearson2699/swift-ios-skills