One Logo Pool Ball
WidgetKit · IOS API REFERENCE

IntentConfiguration

struct · iOS 14.0+ · SDK 27.1

@MainActor @preconcurrency struct IntentConfiguration<Intent, Content> where Intent : INIntent, Content : View

An object describing the content of a widget that uses a custom intent definition to provide user-configurable options. The following example shows the configuration for a game widget that displays details about a chosen character. struct CharacterDetailWidget: Widget { var body: some WidgetConfiguration { IntentConfiguration( kind: "com.mygame.character-detail", intent: SelectCharacterIntent.self, provider: CharacterDetailProvider(), ) { entry in CharacterDetailView(entry: entry) } .configurationDisplayName("Character Details") .description("Displays a character's health and other details") .supportedFamilies([.systemSmall, .systemMedium, .systemLarge]) } } Every widget has a unique `kind`, a string that you choose. You use this string to identify your widget when reloading its timeline with <doc:WidgetCenter>. The `intent` is a custom SiriKit intent definition containing user-editable parameters. The timeline provider is an object that determines the timeline for refreshing your widget. Providing future dates for updating your widget allows the system to optimize the refresh process. The content closure contains the SwiftUI views that WidgetKit needs to render the widget. When WidgetKit invokes the content closure, it passes a timeline entry created by the widget provider's <doc:WidgetKit/IntentTimelineProvider/getSnapshot(for:in:completion:)> or <doc:WidgetKit/IntentTimelineProvider/getTimeline(for:in:completion:)> method. Modifiers let you specify the families your widget supports, and the details shown when users add or edit their widgets.

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

IntentConfiguration.body

This protocol needs associated types that cannot yet cross the bridge.

IntentConfiguration.init(kind:intent:provider:content:)

This declaration needs Swift generic type arguments. (no canonical witness for Provider)

All WidgetKit types →