getSupportedTimeTravelDirections(for:withHandler:)
Determines whether your complication can provide timeline entries for the future or the past.
Declaration
optional func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> Void)Parameters
- complication:
The complication tied to the request.
- handler:
The handler to execute with the Time Travel directions. This block has no return value and takes the following parameter:
- directions
The supported time travel directions. You may combine the values of the Clkcomplicationtimetraveldirections type when specifying this value.
Mentioned in
Discussion
The system calls this method to determine whether your app can provide future or past data entries for the specified complication type. Your implementation of this method must execute the block in the handler parameter and specify the supported directions.
Include the backward constant if your app provides a historical record of events that have occurred or information that was valid at specific times. For example, a music app could provide entries for songs that have already played.
Include the forward constant if your app is able to generate complication data tied to future dates. For example, a calendar app would provide entries for future meeting times.
In watchOS 7 and later, the system checks the value returned by getTimelineEndDate(for:withHandler:) instead. If the method returns a non-nil value, ClockKit attempts to bulk load future timeline entries. Otherwise, it only asks for the current timeline entry.
Topics
Time Travel Directions
See Also
Deprecated methods
CLKLaunchedTimelineEntryDateKeyCLKLaunchedComplicationIdentifierKeygetComplicationDescriptors(handler:)handleSharedComplicationDescriptors(_:)getLocalizableSampleTemplate(for:withHandler:)getPrivacyBehavior(for:withHandler:)CLKComplicationPrivacyBehaviorgetAlwaysOnTemplate(for:withHandler:)getTimelineEndDate(for:withHandler:)getCurrentTimelineEntry(for:withHandler:)getTimelineEntries(for:after:limit:withHandler:)getTimelineAnimationBehavior(for:withHandler:)CLKComplicationTimelineAnimationBehaviorCLKComplicationTimeTravelDirectionsgetTimelineStartDate(for:withHandler:)