Protocol

Widget

The configuration and content of a widget to display on the Home screen or in Notification Center. ホーム画面上でまたは通知センターにおいて表示するあるウィジェットの構成設定および内容。

Declaration 宣言

protocol Widget

Overview 概要

Widgets show glanceable and relevant content from your app right on the iOS Home screen or in Notification Center on macOS. Users can add, configure, and arrange widgets to suit their individual needs. You can provide multiple types of widgets, each presenting a specific kind of information. When users want more information, like to read the full article for a headline or to see the details of a package delivery, the widget lets them get to the information in your app quickly.

There are three key components to a widget:

  • A configuration that determines whether the widget is configurable, identifies the widget, and defines the SwiftUI views that show the widget’s content.

  • A timeline provider that drives the process of updating the widget’s view over time.

  • SwiftUI views used by WidgetKit to display the widget.

For information about adding a widget extension to your app, and keeping your widget up to date, see Creating a Widget Extension and Keeping a Widget Up To Date, respectively.

By adding a custom SiriKit intent definition, you can let users customize their widgets to show the information that’s most relevant to them. If you’ve already added support for Siri or Shortcuts, you’re well on your way to supporting customizable widgets. For more information, see Making a Configurable Widget.

Topics 話題

Implementing a Widget ウィジェットの実装

Running a Widget

See Also 参照

Widgets