clockkit

Apple Watch Complication not updating in background

家住魔仙堡 提交于 2020-12-31 06:42:29
问题 I have an Apple Watch complication that initializes correctly and show the data I am expecting. However, when the NSDate returned in my getNextRequestedUpdateDateWithHandler method triggers a refresh, the only method in my delegate that gets called again is the getNextRequestedUpdateDateWithHandler method (I set breakpoints at every method to determine this). I would have expected requestedUpdateDidBegin to get called when the requested update date occurs, but that doesn't seem to be the case

Apple Watch Complication not updating in background

坚强是说给别人听的谎言 提交于 2020-12-31 06:40:13
问题 I have an Apple Watch complication that initializes correctly and show the data I am expecting. However, when the NSDate returned in my getNextRequestedUpdateDateWithHandler method triggers a refresh, the only method in my delegate that gets called again is the getNextRequestedUpdateDateWithHandler method (I set breakpoints at every method to determine this). I would have expected requestedUpdateDidBegin to get called when the requested update date occurs, but that doesn't seem to be the case

Get Data to Complication: ExtensionDelegate not Called

五迷三道 提交于 2020-01-22 20:18:07
问题 (It looks like this issue has been encountered by others in previous weeks, but there haven't been any solutions that I've found.) I'm trying to do a really basic thing: Get data from either my iOS app or my Watch app to my Complication Controller. I am turning out to be way less capable of getting this done than I thought. watchOS 2 Transition Guide indicates that I should "[fetch] the needed data from the extension delegate" using the following code: ExtensionDelegate* myDelegate = [

Setting tintColor for Apple Watch complication

心已入冬 提交于 2019-12-24 17:12:20
问题 I am trying to set the header text color for a Modular Large complication. I have already customized the watch face to use Multicolor. However, when I build and run this code, the header text color is still white (which is the default). Why isn't the color updating? private func templateForClassModularLarge(className: Schedule) -> CLKComplicationTemplateModularLargeStandardBody { let template = CLKComplicationTemplateModularLargeStandardBody() let headerTextProvider = CLKSimpleTextProvider

how to wake up iOS parent app with sendMessage from complicationController

好久不见. 提交于 2019-12-22 12:31:50
问题 I am trying to wake up the iOS parent app by sending a message from watchkit extension. This though does only work when below sendMessage function is called from the watchApp / ViewController. When it is called from ComplicationController, the message is sent, but the iOS parent app does now wake up. Any advice appreciated. (please any code reference in Swift) Here the simplified code: In AppDelegate and ExtensionDelegate: override init() { super.init() setupWatchConnectivity() } private func

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

别来无恙 提交于 2019-12-17 17:32:12
问题 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:

Where and When to get data for Watch Complication

╄→尐↘猪︶ㄣ 提交于 2019-12-17 10:27:11
问题 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

watchOS - Complication shows previous entry

半腔热情 提交于 2019-12-13 02:13:12
问题 I'm creating a watchOS 3 complication that shows departure times from a public transit service. I've created a data model with an array that contains Train objects with a stationName (String) and departureTime (NSDate). I've implemented the getCurrentTimelineEntry() method and the entries are showing on the watch. The problem is that the watch shows only the previous entry. For example, I've the following departure times: Train(startStation: "Station name", endStation: "Station name",

ClockKit CLKComplicationDataSource missing backward events

爷,独闯天下 提交于 2019-12-11 06:42:27
问题 I write a test app with complications support For some reason clock faces presenting only 1-2 backward events, but I can see in logs 10-15 events before current date. And when I return an empty array for forward events all my backward events start showing in clock face. Here is my function func getTimelineEntriesForComplication(complication: CLKComplication, beforeDate date: NSDate, limit: Int, withHandler handler: (([CLKComplicationTimelineEntry]?) -> Void)) { var entries:

Force reload watchOS 2 Complications

大城市里の小女人 提交于 2019-12-08 06:01:44
问题 I have issues getting Complications to work. It would be helpful if I was able to reliably refresh them. Therefore I linked a force-press menu button to the following method @IBAction func updateComplication() { let complicationServer = CLKComplicationServer.sharedInstance() for complication in complicationServer.activeComplications { complicationServer.reloadTimelineForComplication(complication) } } Unfortunately this leads to the app crashing. with a fatal error: unexpectedly found nil