var body: Self.Body
associatedtype Body : WidgetConfiguration
protocol WidgetConfiguration
struct EmptyWidgetConfiguration
Availability 有効性
Technology
protocol Widget
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.
var body: Self.Body
associatedtype Body : WidgetConfiguration
protocol WidgetConfiguration
struct EmptyWidgetConfiguration
init()
body
as its content.static func main()
protocol WidgetBundle