I am trying get a custom ClockKit Complication working.
- I created a custom ComplicationController conforming to
CLKComplicationDataSource
. It’s added to the Watch Extension’s plist asCLKComplicationPrincipalClass
.
I am able to select a complication on the watch and activate it but I only see "---------------" not my actual placeholder.
What I tried
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 complicationsif let server = CLKComplicationServer.sharedInstance() { for complication in server.activeComplications { server.reloadTimelineForComplication(complication) } }
… but
server
returns nil. No complications appear to be active and reloaded.
Question
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.