accessorysetupkit
Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery…
Implement, review, or improve WidgetKit widgets and controls. Use when building Home Screen, Lock Screen, StandBy, or CarPlay widgets with timeline providers; configurable widgets with AppIntentTimelineProvider; interactive widgets or Control Center controls with Button/Toggle
$ npx -y skills add dpearson2699/swift-ios-skills --skill widgetkit --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/widgetkitContext preview
The summary Claude sees to decide when to auto-load this skill.
Implement, review, or improve WidgetKit widgets and controls. Use when building Home Screen, Lock Screen, StandBy, or CarPlay widgets with timeline providers; configurable widgets with AppIntentTimelineProvider; interactive widgets or Control Center controls with Button/Toggle
name: widgetkit description: "Implement, review, or improve WidgetKit widgets and controls. Use when building Home Screen, Lock Screen, StandBy, or CarPlay widgets with timeline providers; configurable widgets with AppIntentTimelineProvider; interactive widgets or Control Center controls with Button/Toggle wiring; WidgetKit push reloads, refresh budgets, deep links, Smart Stack relevance, Liquid Glass/accented rendering, widget extension setup, WidgetBundle, App Groups, and entitlements."
Build home screen widgets, Lock Screen widgets, Control Center controls, and StandBy or CarPlay widget surfaces for iOS 26+.
Keep adjacent-framework guidance scoped to WidgetKit integration. Include ActivityKit and App Intents only where they connect directly to WidgetKit surfaces; hand off full lifecycle, APNs content-state, Siri/Shortcuts/Spotlight, or entity-modeling work to sibling `activitykit` or `app-intents` skills.
See [references/widgetkit-advanced.md](references/widgetkit-advanced.md) for timeline strategies, push-based updates, Xcode setup, and advanced patterns.
1. Add a Widget Extension target in Xcode (File > New > Target > Widget Extension). 2. Enable App Groups for shared data between the app and widget extension. 3. Define a `TimelineEntry` struct with a `date` property and display data. 4. Implement a `TimelineProvider` (static) or `AppIntentTimelineProvider` (configurable). 5. Build the widget view using SwiftUI, adapting layout per `WidgetFamily`. 6. Declare the `Widget` conforming struct with a configuration and supported families. 7. Register all widgets in a `WidgetBundle` annotated with `@main`.
1. Register an `ActivityConfiguration` in the widget bundle when the app has a Live Activity, but keep `ActivityAttributes`, request/update/end, APNs `content-state`, and Dynamic Island layout depth in `activitykit`. 2. Place `Button`, `Toggle`, `ControlWidgetButton`, and `ControlWidgetToggle` in WidgetKit views or controls, but keep intent modeling, entities, queries, Siri, Shortcuts, and Spotlight in `app-intents`.
1. Reuse an `AppIntent`/`OpenIntent` for a button, or a `SetValueIntent` for a toggle. 2. Create a `ControlWidgetButton` or `ControlWidgetToggle` in the widget bundle. 3. Use `StaticControlConfiguration` or `AppIntentControlConfiguration`.
Run through the Review Checklist at the end of this document.
Every widget conforms to the `Widget` protocol and returns a `WidgetConfiguration` from its `body`.
struct OrderStatusWidget: Widget {
let kind: String = "OrderStatusWidget"
var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: OrderProvider()) { entry in
OrderWidgetView(entry: entry)
}
.configurationDisplayName("Order Status")
.description("Track your current order.")
.supportedFamilies([.systemSmall, .systemMedium])
}
}Use `WidgetBundle` to expose multiple widgets from a single extension.
@main
struct MyAppWidgets: WidgetBundle {
var body: some Widget {
OrderStatusWidget()
FavoritesWidget()
DeliveryActivityWidget() // ActivityConfiguration handoff
QuickActionControl() // Control Center
}
}Use `StaticConfiguration` for non-configurable widgets. Use `AppIntentConfiguration` (recommended) for configurable widgets paired with `AppIntentTimelineProvider`.
// Static
StaticConfiguration(kind: "MyWidget", provider: MyProvider()) { entry in
MyWidgetView(entry: entry)
}
// Configurable
AppIntentConfiguration(kind: "ConfigWidget", intent: SelectCategoryIntent.self,
provider: CategoryProvider()) { entry in
CategoryWidgetView(entry: entry)
}| Modifier | Purpose | |---|---| | `.configurationDisplayName(_:)` | Name shown in the widget gallery | | `.description(_:)` | Description shown in the widget gallery | | `.supportedFamilies(_:)` | Array of `WidgetFamily` values | | `.supplementalActivityFamilies(_:)` | Live Activity sizes (`.small`, `.medium`) |
For static (non-configurable) widgets. Uses completion handlers. Three required methods:
struct WeatherProvider: TimelineProvider {
typealias Entry = WeatherEntry
func placeholder(in context: Context) -> WeatherEntry {
WeatherEntry(date: .now, temperature: 72, condition: "Sunny")
}
func getSnapshot(in context: Context, completion: @escaping (WeatherEntry) -> Void) {
let entry = context.isPreview
? placeholder(in: context)
: WeatherEntry(date: .now, temperature: currentTemp, condition: currentCondition)
completion(entry)
}
func getTimeline(in context: Context, completion: @escaping (Timeline<WeatherEntry>) -> Void) {
Task {
let weather = await Weath86 agent skills optimized for iOS 26+ development with Swift 6.3 and modern Apple frameworks.
Repo: dpearson2699/swift-ios-skills
Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery…
Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for…
Measure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks,…
Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers…
Build iOS App Clips with invocation URLs, App Clip Codes, NFC, QR codes, Safari banners, Maps, Messages, target setup, App Store Connect experiences,…
Implement App Intents for Siri, Shortcuts, Spotlight, widgets, Control Center, and Apple Intelligence on iOS. Covers AppIntent actions, AppEntity and…