Wednesday, March 9, 2016

WatchOS snap to next row on scroll in WKInterfaceTable

Leave a Comment

Apple's own Activity app has an interesting feature that I try to re-implement in my own watch app: Each page in the activity app is scrollable and basically has 2 vertical pages. The first page is the circle and the second page shows more information.

But these pages don't normally scroll up and down when using the digital crown - they snap. So you can't scroll in between pages. Apple seems to be using a WKInterfaceTable with two rows but I don't find any documentation how you can implement the snapping behavior.

How did they do it?

1 Answers

Answers 1

You can use WKInterfaceTable's - (void)scrollToRowAtIndex:(NSInteger)index to scroll to a specific row. To get feedback from the digital crown directly you'd have to use WKInterfacePicker, but that may or may not work in your case.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment