I am trying get a custom ClockKit Complication working.
CLKComplicationDataSource
. It’s added to the Watch Extension’s plist as CLKComplicationPrincipalClass
.I am able to select a complication on the watch and activate it but I only see "---------------" not my actual placeholder.
I added custom override init(){…}
to my ComplicationController and put a break point in it for debugging. But even when running the Complication build scheme this break point is never reached. It seems like my custom ComplicationController is never instantiated.
I do see a log message Extension received request to wake up for complication support.
but it’s not clear to me where this is triggered in the code.
I also tried calling the following from my main InterfaceController
to find out about my active complications
if let server = CLKComplicationServer.sharedInstance() {
for complication in server.activeComplications {
server.reloadTimelineForComplication(complication)
}
}
… but server
returns nil. No complications appear to be active and reloaded.
How do I successfully hook up my custom ComplicationController?
Also any additional tips for debugging are welcome.
Is it usually enough to remove the complications from the watch simulator or the watch app on the iPhone or do you need to re-install the whole watch app to see a complication related update in effect? Also, when I log something inside my custom ComplicationController, should I only see its output when running with the Complications build scheme or also with the normal Watch App build scheme?
Any ideas for finding the issue are welcome.
Since you are actually able to select the complication on the watch, it sounds like everything project wise is setup correctly. Since its not hitting the breakpoint it sounds like the complication just can't find your custom controller. Since you are using swift you will need to specify the module of the controller. Try changing the CLKComplicationPrincipalClass value in your watch app's plist to:
$(PRODUCT_MODULE_NAME).ComplicationController
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With