relevance
Swift declarationvar relevance: TimelineEntryRelevance? { get }The relevance of a widget’s content to the user.
protocol · iOS 14.0+ · SDK 27.1
protocol TimelineEntryA type that specifies the date to display a widget, and, optionally, indicates the current relevance of the widget's content. A <doc:TimelineProvider> creates one or more timeline entries with dates that tell WidgetKit when to display a widget. To render a widget, WidgetKit executes the `content` block of the widget's configuration, passing the corresponding timeline entry. When you declare a structure conforming to `TimelineEntry`, include any additional information that the configuration’s content block requires to render the widget. The following code shows a timeline entry structure for a widget that displays a game character's health level. struct CharacterDetailEntry: TimelineEntry { var date: Date var healthLevel: Double } The content block of the widget's configuration receives the entry as a parameter and then passes the relevant information to the view that renders your widget. struct CharacterDetailWidget: Widget { var body: some WidgetConfiguration { StaticConfiguration( kind: "com.mygame.character-detail", provider: CharacterDetailProvider()) { entry in CharacterDetailView(entry: entry) } .configurationDisplayName("Character Details") .description("Displays a character's health and other details") .supportedFamilies([.systemSmall, .systemMedium, .systemLarge]) } }
var relevance: TimelineEntryRelevance? { get }The relevance of a widget’s content to the user.
No declarations were skipped in this snapshot.