<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/TimelineSchedule/periodic(from:by:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI16TimelineSchedulePA2A08PeriodiccD0VRszrlE8periodic4from2byAE10Foundation4DateV_SdtFZ"
  },
  "title" : "periodic(from:by:)"
}
-->

# periodic(from:by:)

A schedule for updating a timeline view at regular intervals.

```
@export(implementation) static func periodic(from startDate: Date, by interval: TimeInterval) -> PeriodicTimelineSchedule
```

## Parameters

`startDate`

The date on which to start the sequence.

`interval`

The time interval between successive sequence entries.

## Discussion

Initialize a [`TimelineView`](/documentation/SwiftUI/TimelineView) with a periodic timeline schedule when
you want to schedule timeline view updates periodically with a custom
interval:

```
TimelineView(.periodic(from: startDate, by: 3.0)) { context in
    Text(context.date.description)
}
```

The timeline view updates its content at the start date, and then
again at dates separated in time by the interval amount, which is every
three seconds in the example above. For a start date in the
past, the view updates immediately, providing as context the date
corresponding to the most recent interval boundary. The view then
refreshes normally at subsequent interval boundaries. For a start date
in the future, the view updates once with the current date, and then
begins regular updates at the start date.

The schedule defines the [`PeriodicTimelineSchedule.Entries`](/documentation/SwiftUI/PeriodicTimelineSchedule/Entries)
structure to return the sequence of dates when the timeline view calls
the [`entries(from:mode:)`](/documentation/SwiftUI/PeriodicTimelineSchedule/entries(from:mode:)) method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)