I know it has been available for literally less than 48 hours, but I was wondering if anyone has figured out how to programmatically access the digital crown on the Apple Watch in watchOS 2? Is there not an Objective-C method, such as -(void)crownMovedWithTimeStamp(float)timeStamp
, that I can override the implementation of? (My thinking was that this method could be a method of WKInterfaceController and would be called at a set interval (like every time the digital crown is spun an angle of 1 degree)). Like what is done to receive touches in an UIView using the methods such as -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
. Any help would be greatly appreciated, thanks.
Asked
Active
Viewed 959 times
6

Tristan Barnes
- 83
- 6
1 Answers
0
Looks like in WatchOS 2, Apple has introduced WKInterfacePicker
class.
From the Docs:
The user interacts with a picker by tapping it, using the crown to scroll through items, and tapping again to select an item.
When the user selects a new value, WatchKit calls the picker’s action method to report that new value. The format of the picker’s action method is as follows:
- (IBAction)pickerAction:(NSInteger)index
More Docs : Animation when turning crown
Coordinated interface objects. For sophisticated picker interfaces, you can link the picker to one or more WKInterfaceImage or WKInterfaceGroup objects that contain animated image sequences. As the user turns the Digital Crown to select the next picker item, the picker updates the displayed image in each coordinated object.

ntsh
- 759
- 5
- 19
-
So, for instance, is there no current way to be able to use the Crown without a WK element? (For example, to fade in and out an image as it is turned?) – Tristan Barnes Jun 10 '15 at 04:04
-
@TristanBarnes : Looks like we can have animations when the crown is turned. Added the docs link for the animation in the answer. – ntsh Jun 10 '15 at 08:41
-
I guess I gave a bad example of what I am looking for lol. (However, this information is great and thank you for sharing it here). Is there not any method I can over write like in the example in the question? I want to be able to draw a square using Core Graphics with the rest of the space filled in black and I would then display this image with a WKInterfaceImage. When the crown is turned I would make the square go up and down by creating a new image. *However*, when the user taps the screen, the square would move along the x-axis. (Thus, there would be too many possibilities 4 pre-made imgs) – Tristan Barnes Jun 10 '15 at 14:18
-
@TristanBarnes, You would probably be able to do this using `WKInterfaceImage`'s `setImage:` method. I have not tried it yet, since this is brand new, but looks like it should be possible after reading the docs. Why don't you try the methods provided in the linked docs, and if you are facing any code issues, post a new question specific to your code. Hope it helps :) – ntsh Jun 10 '15 at 18:05
-
Okey dokey, when I get the chance I'll do it. Thanks for the help! – Tristan Barnes Jun 10 '15 at 18:14