clockkit

watchOS - Show realtime departure data on complication

醉酒当歌 提交于 2019-12-03 21:23:46
问题 I have an public transport app with realtime departure data for trains. I would like to add a complication that shows the departure time of the next train. Is it possible to show (or refresh) realtime data on a complication? For example, showing "3 min. to station X." The data could change every minute, based on info that comes from the public transport API. How should I accomplish this on watchOS 2 or watchOS 3? I know the ETA app shows travel times in a complication, but I'm not sure how

watchOS - Show realtime departure data on complication

拈花ヽ惹草 提交于 2019-11-30 22:37:49
I have an public transport app with realtime departure data for trains. I would like to add a complication that shows the departure time of the next train. Is it possible to show (or refresh) realtime data on a complication? For example, showing "3 min. to station X." The data could change every minute, based on info that comes from the public transport API. How should I accomplish this on watchOS 2 or watchOS 3? I know the ETA app shows travel times in a complication, but I'm not sure how they achieve that. Are realtime updates possible? Complications aren't designed to show realtime data.

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