Considering Table Input
If you look at the documentation for WKInterfaceTable, you may notice that there is no delegate property nor (seemingly) any way to handle when the user taps your table. Is this some massive oversight of WatchKit? Do you need to search for a cryptic informal protocol in Objective-C? Turns out the answer is no for both questions. When the user interacts with a WKInterfaceTable, those interactions are automatically forwarded to the table’s containing interface controller, much like the responder chain automatically forwards touch events on iOS. Specifically, you want to look at WKInterfaceController’s table(_:didSelectRowAtIndex:) method, which watchOS will call whenever the user taps a row.
In your table, you’ll probably ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access