---
title: "getTimelineEntries(for:before:limit:withHandler:)"
framework: clockkit
role: symbol
role_heading: Instance Method
path: "clockkit/clkcomplicationdatasource/gettimelineentries(for:before:limit:withhandler:)"
---

# getTimelineEntries(for:before:limit:withHandler:)

Retrieves past timeline entries for the complication.

## Declaration

```swift
optional func getTimelineEntries(for complication: CLKComplication, before date: Date, limit: Int, withHandler handler: @escaping ([CLKComplicationTimelineEntry]?) -> Void)
```

## Parameters

- `complication`: The complication tied to the request. Use the complication family information in this object to determine which set of templates are valid.
- `date`: The end date for providing past entries. The dates for your timeline entries should occur before this date and be as close to the date as possible.
- `limit`: The maximum number of entries to provide.
- `handler`: The handler to execute with the past timeline data. This block has no return value and takes the following parameter:

## Discussion

Discussion Only implement this method if your app supports Time Travel on watchOS 4 or earlier. Use this method to build an array of timeline entries with your app’s past data. Each timeline entry contains the data and the date at which that data is valid. Don’t provide entries with dates after the one in the date parameter, and limit the number of entries you create to the value in the limit parameter. The array you return must start in the past and extend forward into time, ending no later than the date specified in the date parameter. Each successive entry in the array must come after the one before it. Entries must be greater than one minute apart. If two entries are less than one minute apart, ClockKit discards one of the entries. Don’t include the current entry in your array. That entry is retrieved separately using the getCurrentTimelineEntry(for:withHandler:) method. If you don’t implement this method, ClockKit doesn’t try to add earlier entries to the timeline.

## See Also

### Deprecated methods

- [CLKLaunchedTimelineEntryDateKey](clockkit/clklaunchedtimelineentrydatekey.md)
- [CLKLaunchedComplicationIdentifierKey](clockkit/clklaunchedcomplicationidentifierkey.md)
- [getComplicationDescriptors(handler:)](clockkit/clkcomplicationdatasource/getcomplicationdescriptors(handler:).md)
- [handleSharedComplicationDescriptors(_:)](clockkit/clkcomplicationdatasource/handlesharedcomplicationdescriptors(_:).md)
- [getLocalizableSampleTemplate(for:withHandler:)](clockkit/clkcomplicationdatasource/getlocalizablesampletemplate(for:withhandler:).md)
- [getPrivacyBehavior(for:withHandler:)](clockkit/clkcomplicationdatasource/getprivacybehavior(for:withhandler:).md)
- [CLKComplicationPrivacyBehavior](clockkit/clkcomplicationprivacybehavior.md)
- [getAlwaysOnTemplate(for:withHandler:)](clockkit/clkcomplicationdatasource/getalwaysontemplate(for:withhandler:).md)
- [getTimelineEndDate(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineenddate(for:withhandler:).md)
- [getCurrentTimelineEntry(for:withHandler:)](clockkit/clkcomplicationdatasource/getcurrenttimelineentry(for:withhandler:).md)
- [getTimelineEntries(for:after:limit:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineentries(for:after:limit:withhandler:).md)
- [getTimelineAnimationBehavior(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineanimationbehavior(for:withhandler:).md)
- [CLKComplicationTimelineAnimationBehavior](clockkit/clkcomplicationtimelineanimationbehavior.md)
- [getSupportedTimeTravelDirections(for:withHandler:)](clockkit/clkcomplicationdatasource/getsupportedtimetraveldirections(for:withhandler:).md)
- [CLKComplicationTimeTravelDirections](clockkit/clkcomplicationtimetraveldirections.md)
