SkyWatch — Requirements
Personas
- Casual checker — opens the app once a day, wants to know if it’s going to rain. Sees the home screen, leaves. Should be sub-5-second-experience.
- Outdoor planner — checks the hourly forecast before deciding to go for a run, picks a saved location near the trailhead, checks precipitation map. Should be sub-15-second.
- Severe-weather watcher — has notifications on, wants Lock Screen widget to surface the alert immediately and an in-app deep dive into the alert details.
User stories
Onboarding
- As a first-time user, I see a single screen explaining what SkyWatch does and tap “Get Started,” which triggers the location permission prompt with a clear
NSLocationWhenInUseUsageDescription. - If I deny location, the app falls back to a search bar where I can type a city. Denial is not a dead-end.
- After granting permission, I land on the home screen showing the current location’s weather within 2 seconds (cached if possible).
Home
- The home screen shows: current temperature, condition icon, “feels like,” 24-hour scrubbable timeline, next 7 days, and the WeatherKit attribution badge per Apple’s requirement.
- The timeline updates the displayed hour as I scrub; numbers don’t flicker.
- I can swipe left/right to switch between my saved locations.
- Pull-to-refresh forces a fresh WeatherKit call (subject to a 5-minute minimum interval to protect the budget).
Saved locations
- I can tap “+” to add a saved location via map pin drop, search, or “Use My Current Location.”
- Saved locations sync via CloudKit private DB across my devices automatically; I do not have to log in (CloudKit uses my Apple ID).
- I can reorder and delete saved locations. Deletion is immediate, no undo (matches Apple Weather).
- If sync fails (network, quota), the app shows a non-modal status indicator, never blocks the UI.
Map
- From a saved location, I can tap “Map” to see a MapKit view centered on that location with a heatmap overlay for precipitation in the next hour.
- The overlay scrubs forward in 5-minute intervals via a slider at the bottom.
- Annotations show nearby saved locations as smaller pins so I can quickly switch.
Widgets
- A Lock Screen widget (
accessoryCircularandaccessoryRectangular) shows the next-hour precipitation chance. - A Home Screen widget (
systemSmallandsystemMedium) shows the current temperature, condition icon, and high/low. - Widgets refresh at most every 15 minutes and use cached forecast data; they never call WeatherKit directly from the widget extension.
- If the data is stale > 6 hours, the widget shows “Tap to refresh” rather than fake data.
App Intents
- The Shortcut “Get weather for [location]” returns the current temperature, condition, and the next hour’s precipitation chance.
- The Shortcut works without launching the app (background execution allowed by intent).
Alerts
- If WeatherKit reports any severe alert for a saved location, the user receives a local notification using
UNUserNotificationCenterkeyed to the alert ID (to avoid duplicates). - Tapping the notification deep-links to the alert detail screen.
Acceptance criteria
- Cold-start to home screen with cached data: < 2 seconds on iPhone 13.
- Cold-start to home screen with fresh data: < 5 seconds on a typical LTE connection.
- Widget refresh failure rate: < 1% over a 7-day window (measure via os_signpost + a debug counter).
- WeatherKit calls per user per day: < 8 under normal use (cache hit rate > 80%).
- CloudKit sync conflict rate (locations modified concurrently on two devices): handled gracefully — last-writer-wins with a logged audit trail.
Non-goals
- No paid tier. WeatherKit’s free quota is the limit; no monetization in this capstone.
- No social features (no sharing locations between users, no comments).
- No precipitation forecasts beyond 1 hour for the map (WeatherKit’s
minuteForecastcovers exactly this window). - No iPad-specific UI beyond what SwiftUI gives for free (this is iPhone-first).
Constraints
- iOS 17+ (WeatherKit’s
SwiftAPI, App Intents 2.0, Live Activities). - US-only by default for alerts (WeatherKit alerts have limited international coverage; document this in the README).
- Apple Developer Program membership required (WeatherKit needs a paid account and a
WeatherKitcapability in the App ID).
Out of scope (explicitly)
These will be tempting to add — say no:
- Push notifications via APNs (use local notifications keyed to the saved location’s timeline; APNs requires a server and is a different capstone)
- Marketing site (your GitHub README is enough)
- iCloud key-value store (CloudKit private DB is enough; do not add a second sync layer)
- A backend service of any kind — WeatherKit + CloudKit cover everything
Next: Architecture