One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

PeriodicTimelineSchedule

struct · iOS 15.0+ · SDK 27.1

struct PeriodicTimelineSchedule

A schedule for updating a timeline view at regular intervals. You can also use ``TimelineSchedule/periodic(from:by:)`` to construct this schedule.

Members (2)

init · iOS 15.0+

init

TypeScript
static init(startDate: globalThis.Date, interval: number): PeriodicTimelineSchedule
Swift declaration
init(from startDate: Date, by interval: TimeInterval)

Creates a periodic update schedule. Use the ``PeriodicTimelineSchedule/entries(from:mode:)`` method to get the sequence of dates. - Parameters: - startDate: The date on which to start the sequence. - interval: The time interval between successive sequence entries.

method · iOS 15.0+

entries

TypeScript
entries(startDate: globalThis.Date, mode: TimelineScheduleMode): PeriodicTimelineSchedule_Entries
Swift declaration
func entries(from startDate: Date, mode: TimelineScheduleMode) -> PeriodicTimelineSchedule.Entries

Provides a sequence of periodic dates starting from around a given date. A ``TimelineView`` that you create with a schedule calls this method to ask the schedule when to update its content. The method returns a sequence of equally spaced dates in increasing order that represent points in time when the timeline view should update. The schedule defines its periodicity and phase aligment based on the parameters you pass to its ``init(from:by:)`` initializer. For example, for a `startDate` and `interval` of `10:09:30` and `60` seconds, the schedule prepares to issue dates half past each minute. The `startDate` that you pass to the `entries(from:mode:)` method then dictates the first date of the sequence as the beginning of the interval that the start date overlaps. Continuing the example above, a start date of `10:34:45` causes the first sequence entry to be `10:34:30`, because that's the start of the interval in which the start date appears.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →