Timeline
struct · iOS 14.0+ · SDK 27.1
struct Timeline<EntryType> where EntryType : TimelineEntryAn object that specifies a date for WidgetKit to update a widget's view. To tell WidgetKit when to update a widget’s view, <doc:TimelineProvider> generates a timeline. The timeline contains an array of timeline entry objects and a refresh policy. To create timeline entries, declare a custom type that conforms to `TimelineEntry`. Each entry specifies the date you would like WidgetKit to update the widget's view, and any additional information that your widget needs to render the view. Timeline entries may also include information about their relevance compared to other entries in timelines for the same widget kind. WidgetKit uses this relevance information when considering whether a widget should be promoted in a stack. For more about supplying relevance information, see <doc:TimelineEntryRelevance>. The timeline's refresh policy specifies the earliest date for WidgetKit to request a new timeline from the provider. The default refresh policy, ``WidgetKit/TimelineReloadPolicy/atEnd``, tells WidgetKit to request a new timeline after the last date in the array of timeline entries you provide. However, you can use ``WidgetKit/TimelineReloadPolicy/after(_:)`` to indicate a different date either earlier or later than the default date. Specify an earlier date if you know there's a point in time before the end of your timeline entries that may alter the timeline. Conversely, specify a later date if you know that after the last date, your timeline won't change for some period of time. Alternatively, use ``WidgetKit/TimelineReloadPolicy/never`` to tell WidgetKit not to request a new timeline at all. In that case, your app uses <doc:WidgetCenter> to prompt WidgetKit to request a new timeline. > Note: WidgetKit may not update the widget's view exactly at a timeline entry's date. The update may occur at a later date. For more information about generating timelines, see <doc:TimelineProvider>.
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
Timeline.entries
This declaration needs Swift generic type arguments. (no canonical witness for EntryType)
Timeline.init(entries:policy:)
This declaration needs Swift generic type arguments. (no canonical witness for EntryType)