Instance Method

getNextRequestedUpdateDate(handler:)

Gets the next time at which to update your complication.

Declaration

optional func getNextRequestedUpdateDate(handler: @escaping (Date?) -> Void)

Parameters

handler

The handler to execute with the next date at which to run your complication code. This block has no return value and takes the following parameter:

updateDate

The date after which you would like your complication to run again. If you specify nil, ClockKit does not schedule a new update time for your complication. You can still trigger updates manually.

Discussion

Your implementation of this method must execute the block in the handler parameter and specify an appropriate date. Specify a date as far into the future as you can manage for your complications. ClockKit wakes up your complication at some point after the specified date to request new data. The exact time at which your complication runs is not guaranteed.

If your complication data changes before the specified update date, you can invalidate your complication data using the CLKComplicationServer object.

If you do not implement this method, ClockKit does not schedule your complication for another update. You must trigger updates to your complication’s data manually by extending or reloading your timeline.

See Also

Deprecated Methods

func requestedUpdateDidBegin()

Indicates that a requested update has begun so that you have an opportunity to extend or reload your timeline.

Deprecated
func requestedUpdateBudgetExhausted()

Indicates that your complication’s time budget is exhausted.

Deprecated
func getPlaceholderTemplate(for: CLKComplication, withHandler: (CLKComplicationTemplate?) -> Void)

Gets a static template to display in the selection screen for your complication.

Deprecated