Instance Method

getTimelineStartDate(for:withHandler:)

Retrieves the earliest date for which your complication is prepared to supply data.

Declaration

optional func getTimelineStartDate(for complication: CLKComplication, withHandler handler: @escaping (Date?) -> Void)

Parameters

complication

The complication tied to the request.

handler

The handler to execute with the start date. This block has no return value and takes the following parameter:

date

The start date for your data. For times before this date, WatchKit dims your data to indicate that the timeline doesn’t continue. If you specify nil, ClockKit doesn’t ask for any more past data.

Discussion

Only implement this method if your app supports Time Travel on watchOS 4 or earlier.

Your implementation of this method must execute the block in the handler parameter and specify the earliest date for which you can supply timeline entries. If you don’t support displaying past data using Time Travel, specify the current date.

If you don’t implement this method, ClockKit doesn’t attempt to retrieve timeline entries before the current entry.

See Also

Getting the Timeline Information

func getSupportedTimeTravelDirections(for: CLKComplication, withHandler: (CLKComplicationTimeTravelDirections) -> Void)

Determines whether your complication can provide timeline entries for the future or the past.

Required.

func getTimelineEndDate(for: CLKComplication, withHandler: (Date?) -> Void)

Retrieves the latest date for which your complication is prepared to supply data.