Instance Method

getCurrentTimelineEntry(for:withHandler:)

Retrieves the timeline entry that you want to display now.

Required.

Declaration

func getCurrentTimelineEntry(for complication: CLKComplication, 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.

handler

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

updateInterval

The CLKComplicationTimelineEntry object to display right now.

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.