I want to draw circles like in apple`s activity app on apple watch. Researching about it I find that many do this by just providing an Image for each state of the circle. There is software who help to provide Images like here:
RadialChartImageGenerator
However I want to achieve this with graphic transformations, let´s say e.g. with core graphics
framework.
Anyone knows if this is even possible with watchkit? I don´t want a ready-to-use code solution, just want to know which technologies I can use. Thank you very much.
There are several options you can use here. If you would like the users to be able to interact with it you could use a WKInterfacePicker and define an image sequence. This will let the users scroll via the digital crown and your code will receive an index and you can change images accordingly.
Check out my answer here: Trying to get button to spin in WatchKit
An other approach is to build an AssetCatalog within Xcode with all the images and then animate to a certain image i.e a certain progress percent. Look at this post: http://natashatherobot.com/watchkit-animate/
Here is a similar question aswell: Creating progress circle as WKInterfaceImage in Watch App
To answer your question about CoreGraphics. I looked at the watchOS2 dev. lib. (https://developer.apple.com/library/prerelease/watchos/navigation/) and it seems like CoreGraphics aint included in watchOS2.
Check out WKInterfaceActivityRing
, available in WatchKit since watchOS 2.2:
https://developer.apple.com/documentation/watchkit/wkinterfaceactivityring
Also, for iOS 9.3 or later, there is HKActivityRingView
in HealthKit:
https://developer.apple.com/documentation/healthkit/hkactivityringview
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