TechnologiesUI & App Frameworks

WidgetKit

iOSmacOStvOSwatchOSvisionOS

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.

  • Pr
    TimelineProvider
    A type that advises WidgetKit when to update a widget's display.
  • Pr
    IntentTimelineProvider
    A type that advises WidgetKit when to update a user-configurable
  • Pr
    AppIntentTimelineProvider
    A type that advises WidgetKit when to update a user-configurable
  • Pr
    TimelineEntry
    A 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.

  • St
    Timeline
    An object that specifies a date for WidgetKit to update a widget's view.
  • St
    TimelineProviderContext
    An object that contains details about how a widget is rendered, including
  • St
    TimelineReloadPolicy
    A type that indicates the earliest date WidgetKit requests a new timeline
  • St
    TimelineEntryRelevance
    An 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.

  • St
    DynamicIsland
    The layout and configuration for a Live Activity that appears in the Dynamic Island.
  • St
    DynamicIslandExpandedContent
    A view that describes the expanded presentation of a Live Activity that appears in the Dynamic Island.
  • St
    DynamicIslandExpandedRegion
    A structure that defines and positions the content of an expanded Live Activity in the Dynamic Island.
  • St
    DynamicIslandExpandedRegionPosition
    View positions of an expanded Live Activity that appears in the Dynamic Island.
  • St
    DynamicIslandExpandedRegionVerticalPlacement
    Vertical view positions of an expanded Live Activity that appears in the Dynamic Island.
  • St
    DynamicIslandMode
    A structure that offers values that describe the content mode for a Live Activity.
  • St
    ActivityViewContext
    A structure that describes the view context for creating the views of a Live Activity.
  • En
    ActivityFamily
    A family that defines the Live Activity's size.
  • St
    SupportedActivityFamiliesEnvironmentKey
    An 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.

  • Cl
    WidgetCenter
    An object that contains a list of user-configured widgets and is used for
  • Pr
    WidgetPushHandler
    A type that can receive push information about widget refreshes and
  • St
    WidgetPushInfo
    A structure that contains information about the push token for
  • Pr
    ControlPushHandler
    A type that can receive push information about user-configured controls.
  • St
    ControlPushInfo
    A structure that contains information about the push token of a

Control Center Controls 4

Types for building and supplying values to Control Center controls.

  • Cl
    ControlCenter
    An object you use to access configuration information for controls and reload them.
  • St
    ControlInfo
    A structure that contains information about user-configured controls.
  • Pr
    ControlValueProvider
    A type that provides a value to a control template.
  • Pr
    AppIntentControlValueProvider
    A 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.

  • St
    IntentRecommendation
    An object that describes a recommended intent configuration for a
  • St
    AppIntentRecommendation
    An 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.

  • St
    WidgetRelevance
    A type collecting the relevances for a widget kind.
  • St
    WidgetRelevanceAttribute
    A type that describes when a specific widget could be relevant.
  • St
    WidgetRelevanceGroup
    A 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.

  • St
    WidgetLocation
    Values that indicate different widget locations.
  • St
    WidgetMountingStyle
    Values that define the widget’s supported mounting style.
  • St
    WidgetRenderingMode
    Constants that indicate the rendering mode for a widget.
  • St
    WidgetAccentedRenderingMode
    Constants that indicate the rendering mode for an `Image` in when displayed in a widget
  • St
    LevelOfDetail
    The level of detail the view is recommended to have.

Previews 1

Context used to render widgets in previews and the widget gallery.

  • St
    WidgetPreviewContext
    A specification for the context of a widget preview.

Structures 15

  • St
    AccessoryWidgetBackground
    An adaptive background view that provides a standard appearance based on the
  • St
    ActivityConfiguration
    An object that describes the content of a Live Activity.
  • St
    AppIntentConfiguration
    An object describing the content of a widget that uses a custom intent
  • St
    AppIntentControlConfiguration
    The description of a control that uses a custom app intent to provide
  • St
    ControlWidgetButton
    A control template representing a button.
  • St
    ControlWidgetButtonDefaultActionLabel
    A view representing the default action label for a `ControlWidgetButton` if none
  • St
    ControlWidgetToggle
    A control template representing a toggle.
  • St
    ControlWidgetToggleDefaultLabel
    A view that represents the default label for a toggle control if you don't provide
  • St
    DynamicIslandExpandedContentBuilder
    A result builder that constructs the content of an expanded Live Activity in the Dynamic Island.
  • St
    IntentConfiguration
    An object describing the content of a widget that uses a custom intent
  • St
    PreviewActivityBuilder
  • St
    PreviewTimelineBuilder
  • St
    StaticConfiguration
    An object describing the content of a widget that has no user-configurable
  • St
    StaticControlConfiguration
    The description of a control that has no user-configurable options.
  • St
    WidgetInfo
    A structure that contains information about user-configured widgets.

Enumerations 2

  • En
    ActivityPreviewViewKind
    Values that represent Live Activity presentations for use in Xcode previews.
  • En
    WidgetFamily
    Values that define the widget's size and shape.

Extends 12

EnvironmentValuesImageControlWidgetTemplateViewWidgetConfigurationPreviewWidgetControlWidgetWidgetBundleContainerBackgroundPlacementActivityAttributesControlWidgetConfiguration
← UI & App Frameworks