associatedtype Entries : Sequence
Return Value 戻り値
A sequence of dates in ascending order.
Availability 有効性
Technology
A sequence of dates in ascending order.
startDate
The date by which the sequence begins.
mode
An indication of whether the schedule updates normally, or with some other cadence.
A Timeline
that you create calls this method to figure out when to update its content. The method returns a sequence of dates in increasing order that represent points in time when the timeline view should update. Types that conform to the Timeline
protocol, like the one returned by periodic(from:
, or a custom schedule that you define, implement a custom version of this method to implement a particular kind of schedule.
One or more dates in the sequence might be before the given start
, in which case the timeline view performs its first update at start
using the entry that most closely precedes that date. For example, if in response to a start
of 10:
, the method returns a sequence with the values 10:
, 10:
, 10:
, and so on, the timeline view performs an initial update at 10:
(using the 10:
entry), followed by another update at the beginning of every minute, starting at 10:
.
A type that conforms should adjust its behavior based on the mode
when possible. For example, a periodic schedule providing updates for a timer could restrict updates to once per minute while in the Timeline
mode:
func entries(
from startDate: Date, mode: TimelineScheduleMode
) -> PeriodicTimelineSchedule {
.periodic(
from: startDate, by: (mode == .lowFrequency ? 60.0 : 1.0)
)
}
associatedtype Entries : Sequence