WidgetKit lets you build home screen and Lock Screen widgets, Control Center controls, and Live Activities for iOS, macOS, watchOS, and visionOS using SwiftUI. You drive a widget's content with a timeline: conform to a TimelineProvider, IntentTimelineProvider, or AppIntentTimelineProvider to supply TimelineEntry values in a Timeline, and use a TimelineReloadPolicy to tell the system when to refresh. For Live Activities you compose a DynamicIsland with its expanded regions and ActivityFamily, and you manage reloads and remote updates through WidgetCenter, ControlCenter, and push handlers such as WidgetPushHandler. Types like WidgetRelevance, TimelineEntryRelevance, and WidgetRenderingMode let you influence how and where the system surfaces your widget.
Timeline Providers 4
Protocols you adopt to supply the sequence of entries that drive a widget's content over time.
- PrTimelineProviderA type that advises WidgetKit when to update a widget's display.
- PrIntentTimelineProviderA type that advises WidgetKit when to update a user-configurable
- PrAppIntentTimelineProviderA type that advises WidgetKit when to update a user-configurable
- PrTimelineEntryA type that specifies the date to display a widget, and, optionally,
Timelines and Entries 4
The values and policies that describe a widget's content and when the system should refresh it.
- StTimelineAn object that specifies a date for WidgetKit to update a widget's view.
- StTimelineProviderContextAn object that contains details about how a widget is rendered, including
- StTimelineReloadPolicyA type that indicates the earliest date WidgetKit requests a new timeline
- StTimelineEntryRelevanceAn object that describes the relative importance of a timeline entry
Live Activities and the Dynamic Island 9
Types that compose a Live Activity's Dynamic Island presentation and its expanded regions.
- StDynamicIslandThe layout and configuration for a Live Activity that appears in the Dynamic Island.
- StDynamicIslandExpandedContentA view that describes the expanded presentation of a Live Activity that appears in the Dynamic Island.
- StDynamicIslandExpandedRegionA structure that defines and positions the content of an expanded Live Activity in the Dynamic Island.
- StDynamicIslandExpandedRegionPositionView positions of an expanded Live Activity that appears in the Dynamic Island.
- StDynamicIslandExpandedRegionVerticalPlacementVertical view positions of an expanded Live Activity that appears in the Dynamic Island.
- StDynamicIslandModeA structure that offers values that describe the content mode for a Live Activity.
- StActivityViewContextA structure that describes the view context for creating the views of a Live Activity.
- EnActivityFamilyA family that defines the Live Activity's size.
- StSupportedActivityFamiliesEnvironmentKeyAn environment key for the size of a rendered Live Activity.
Reloading and Push Updates 5
APIs for refreshing widgets and controls and for handling remote push-driven updates.
- ClWidgetCenterAn object that contains a list of user-configured widgets and is used for
- PrWidgetPushHandlerA type that can receive push information about widget refreshes and
- StWidgetPushInfoA structure that contains information about the push token for
- PrControlPushHandlerA type that can receive push information about user-configured controls.
- StControlPushInfoA structure that contains information about the push token of a
Control Center Controls 4
Types for building and supplying values to Control Center controls.
- ClControlCenterAn object you use to access configuration information for controls and reload them.
- StControlInfoA structure that contains information about user-configured controls.
- PrControlValueProviderA type that provides a value to a control template.
- PrAppIntentControlValueProviderA type that uses a custom intent to provide a value to a control template.
Siri Suggestions and Recommendations 2
Types that recommend configured widget intents for the system to surface.
- StIntentRecommendationAn object that describes a recommended intent configuration for a
- StAppIntentRecommendationAn object that describes a recommended intent configuration for a
Relevance 3
Types that describe when and where your widget is most relevant to the user.
- StWidgetRelevanceA type collecting the relevances for a widget kind.
- StWidgetRelevanceAttributeA type that describes when a specific widget could be relevant.
- StWidgetRelevanceGroupA type for configuring widget behavior in the watchOS Smart Stack.
Placement and Rendering 5
Types that describe where a widget appears and how the system renders it.
- StWidgetLocationValues that indicate different widget locations.
- StWidgetMountingStyleValues that define the widget’s supported mounting style.
- StWidgetRenderingModeConstants that indicate the rendering mode for a widget.
- StWidgetAccentedRenderingModeConstants that indicate the rendering mode for an `Image` in when displayed in a widget
- StLevelOfDetailThe level of detail the view is recommended to have.
Previews 1
Context used to render widgets in previews and the widget gallery.
- StWidgetPreviewContextA specification for the context of a widget preview.
Structures 15
- StAccessoryWidgetBackgroundAn adaptive background view that provides a standard appearance based on the
- StActivityConfigurationAn object that describes the content of a Live Activity.
- StAppIntentConfigurationAn object describing the content of a widget that uses a custom intent
- StAppIntentControlConfigurationThe description of a control that uses a custom app intent to provide
- StControlWidgetButtonA control template representing a button.
- StControlWidgetButtonDefaultActionLabelA view representing the default action label for a `ControlWidgetButton` if none
- StControlWidgetToggleA control template representing a toggle.
- StControlWidgetToggleDefaultLabelA view that represents the default label for a toggle control if you don't provide
- StDynamicIslandExpandedContentBuilderA result builder that constructs the content of an expanded Live Activity in the Dynamic Island.
- StIntentConfigurationAn object describing the content of a widget that uses a custom intent
- StPreviewActivityBuilder
- StPreviewTimelineBuilder
- StStaticConfigurationAn object describing the content of a widget that has no user-configurable
- StStaticControlConfigurationThe description of a control that has no user-configurable options.
- StWidgetInfoA structure that contains information about user-configured widgets.
Enumerations 2
- EnActivityPreviewViewKindValues that represent Live Activity presentations for use in Xcode previews.
- EnWidgetFamilyValues that define the widget's size and shape.