Module 17 Β· Widgets & Live Activities β Lesson 2 of 4 Β· ~8 min
A next-walk widget
TimelineProvider: the schedule-maker
A TimelineProvider is the type that hands WidgetKit its TimelineEntry values. Three methods: placeholder(in:) (a generic entry shown while data loads, e.g. in the widget gallery), getSnapshot(in:completion:) (one entry for quick previews, like when the learner is picking a widget), and getTimeline(in:completion:) β the real one, returning an array of entries plus a TimelineReloadPolicy (.atEnd, .after(date), or .never) telling the system when to ask again.
The widget's SwiftUI view just renders one entry at a time β same idea as any other SwiftUI view, just fed by the provider instead of a view model.