Reputation: 13514
I know how to create the basic watch complications.
I want to create complication like native Battery one (Circular Ring).
How can I fetch live data for the complications, maybe API call, or data from iPhone?
Can I create more then one same complication type?
Upvotes: 8
Views: 1611
Reputation: 11276
I want to create complication like native Battery one (Circular Ring).
How can I fetch live data for the complications, maybe API call, or data from iPhone? -
Use WatchKit.framework to do this and use WCSession class to perform the session talking between the phone and the watch.
You could also use the background tasks API introuduced in WatchOS 3 to make API calls in the background - https://developer.apple.com/library/content/releasenotes/General/WhatsNewInwatchOS/Articles/watchOS3.html
To update complications in watch OS 3 - https://developer.apple.com/reference/watchkit/wkapplicationrefreshbackgroundtask
Can I create more then one same complication type?
No you cannot, one app can have only one type of complication.
Upvotes: 1