SwiftUI: How to refresh Apple Watch Complication every day

Viewed 361

I made a Watch complication, it is woks fine but it not updated every day as I set the end date, here is the code in ComplicationController:

    func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> Void) {
    handler([.forward, .backward])
}

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

func getTimelineEndDate(for complication: CLKComplication, withHandler handler: @escaping (Date?) -> Void) {
    handler(Date().addingTimeInterval(60*60*24))
}
0 Answers
Related