Discussion
議論
Initialize a TimelineView
with an every minute timeline schedule when you want to schedule timeline view updates at the start of every minute:
TimelineView(.everyMinute) { context in
Text(context.date.description)
}
The schedule provides the first date as the beginning of the minute in which you use it to initialize the timeline view. For example, if you create the timeline view at 10:09:38
, the schedule’s first entry is 10:09:00
. In response, the timeline view performs its first update immediately, providing the beginning of the current minute, namely 10:09:00
, as context to its content. Subsequent updates happen at the beginning of each minute that follows.
The schedule defines the EveryMinuteTimelineSchedule.Entries
structure to return the sequence of dates when the timeline view calls the entries(from:mode:)
method.