apple-watch-complication

Call ExtensionDelegate to create/refresh data for Complication

一笑奈何 提交于 2019-11-28 14:15:05
All my data creation is done in the ExtensionDelegate.swift . The problem is ExtensionDelegate.swift doesn't get called before the function getCurrentTimelineEntryForComplication in my ComplicationController.swift . Any ideas? Here is my code and details: So my array extEvnts is empty in my ComplicationController.swift : func getCurrentTimelineEntryForComplication(complication: CLKComplication, withHandler handler: ((CLKComplicationTimelineEntry?) -> Void)) { let extEvnts = ExtensionDelegate.evnts } Because my ExtensionDelegate.swift hasn't gotten called yet, which is what creates the data for

What is the flow for updating complication data for Apple Watch?

大憨熊 提交于 2019-11-28 04:11:46
I've been following a lot of tutorials on the internet to learn how to set up the complication. I have no problem getting the complication set up as expected. Until the initial timeline entries expire. After 12 hours, I do not know how to update it to keep the complication live. I'll share everything I have below and hopefully somebody can help fill me in. Here, I create the variables for my data that I want to display on the complication. struct data = { var name: String var startString: String var startDate: NSDate } The following array is a container for this data. var dataArray = [data]

Where and When to get data for Watch Complication

社会主义新天地 提交于 2019-11-27 11:41:35
After working with complications for a few days, I feel confident saying the following about the update process for updates that happen at a prescribed interval: The system calls requestedUpdateDidBegin() This is where you can determine if your data has changed. If it hasn't, your app doesn't have to do anything. If your data has changed, you need to call either: reloadTimelineForComplication if all your data needs to be reset. extendTimelineForComplication if you only need to add new items to the end of the complication timeline. Note: the system may actually call

Is transferCurrentComplicationUserInfo more suitable for complication update?

送分小仙女□ 提交于 2019-11-27 04:56:12
What is the difference between transferCurrentComplicationUserInfo and transferUserInfo ? I want to send data from my AppDelegate to a clock kit complication. transferCurrentComplicationUserInfo seems to do exactly the same thing as transferCurrentUserInfo . Am I missing something? The distinction between these two WCSession methods involve when the data is sent, and whether the watchkit extension is woken up or not. transferCurrentComplicationUserInfo: is specifically designed for transferring complication user info meant to be shown on the watch face right now. The complication user info is

Is transferCurrentComplicationUserInfo more suitable for complication update?

白昼怎懂夜的黑 提交于 2019-11-26 11:26:06
问题 What is the difference between transferCurrentComplicationUserInfo and transferUserInfo ? I want to send data from my AppDelegate to a clock kit complication. transferCurrentComplicationUserInfo seems to do exactly the same thing as transferCurrentUserInfo . Am I missing something? 回答1: The distinction between these two WCSession methods involve when the data is sent, and whether the watchkit extension is woken up or not. transferCurrentComplicationUserInfo: is specifically designed for