
Activitykit
Implement, review, or improve Live Activities and Dynamic Island experiences in iOS...
Install
npx skills add dpearson2699/swift-ios-skills --skill activitykit -g -a claude-code -y- Repository
- dpearson2699/swift-ios-skills1.3k
- Category
- Mobile
- Updated
- 3mo ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for the Lock Screen and Dynamic Island, delivery tracking, sports scores, ride-sharing status, workout timers, media playback, or any time-sensitive information that updates in real time. Also use when working with ActivityKit, ActivityAttributes, Activity lifecycle (request/update/end), Dynamic Island layouts (compact/minimal/expanded), push-to-update Live Activities, or Lock Screen live widgets.
ActivityKit
ActivityKit owns real-time, glanceable Live Activities displayed on the Lock
Screen and Dynamic Island. Ordinary timeline widgets belong in widgetkit, and
generic APNs setup belongs in push-notifications; ActivityKit owns the Live
Activity lifecycle and payload contract. aps.content-state must decode into
the exact ActivityAttributes.ContentState shape, including any coordinated
custom date/range encoding. Modern ActivityContent lifecycle examples require
iOS 16.2+ unless noted.
See references/activitykit-patterns.md for complete code patterns including push payload formats, concurrent activities, state observation, and testing.
Contents
- Workflow
- ActivityAttributes Definition
- Activity Lifecycle
- Lock Screen Presentation
- Dynamic Island
- Push-to-Update
- Recent Additions
- Common Mistakes
- Review Checklist
- References
Workflow
1. Create a new Live Activity
- Verify the host app capability and
NSSupportsLiveActivities = YES. - Define
ActivityAttributes.ContentState; encode and decode a representative fixture that matches the server payload contract. - Create
ActivityConfigurationand preview Lock Screen and Dynamic Island states, including stale and terminal content. - Check
ActivityAuthorizationInfo.areActivitiesEnabled, then request and observe the activity lifecycle. - Exercise local update and every terminal end path.
- For remote updates, validate a complete reference payload before registering rotating update or push-to-start tokens with the server.
2. Review existing Live Activity code
Run through the Review Checklist at the end of this document.
