getCurrentTimelineEntry(for:withHandler:)
Retrieves the timeline entry that you want to display now.
Declaration
func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> Void)func currentTimelineEntry(for complication: CLKComplication) async -> CLKComplicationTimelineEntry?Parameters
- complication:
The complication tied to the request. Use the complication family information in this object to determine which set of templates are valid.
- handler:
The handler to execute with the current data. This block has no return value and takes the following parameter:
updateIntervalThe Clkcomplicationtimelineentry object to display right now.
Mentioned in
Discussion
Your implementation of this method must create a timeline entry with the data to display right now. Assign a date to your timeline entry that reflects the current time or a time before the current time. If your complication supports past timeline entries, the entry you return from this method must come after all past entries that you provide using the getTimelineEntries(for:before:limit:withHandler:) method.
See Also
Deprecated methods
CLKLaunchedTimelineEntryDateKeyCLKLaunchedComplicationIdentifierKeygetComplicationDescriptors(handler:)handleSharedComplicationDescriptors(_:)getLocalizableSampleTemplate(for:withHandler:)getPrivacyBehavior(for:withHandler:)CLKComplicationPrivacyBehaviorgetAlwaysOnTemplate(for:withHandler:)getTimelineEndDate(for:withHandler:)getTimelineEntries(for:after:limit:withHandler:)getTimelineAnimationBehavior(for:withHandler:)CLKComplicationTimelineAnimationBehaviorgetSupportedTimeTravelDirections(for:withHandler:)CLKComplicationTimeTravelDirectionsgetTimelineStartDate(for:withHandler:)