The most fundamental differences between WKInterfaceTable and UITableView relate to the way row content is set up. The interesting thing about WatchKit’s approach here is that it’s in direct contrast with the way iOS does it, and yet UIKit on iOS works the way it does for performance reasons. You’d think the lowest power device—Apple Watch—would have the most efficient API for table performance, but the needs are quite different.
The WKInterfaceTable API remains virtually unchanged from watchOS 1. You may recall that in WatchKit for watchOS 1, every time a method is called in your WatchKit extension and the watch UI is updated, Bluetooth communication is happening between the watch and the phone. If WKInterfaceTable were to use the same API as UITableView, then the watch and phone would be in constant communication while the user scrolled the table. That would have a huge battery-life penalty, so instead all the data is communicated at once and cached on the watch, and WatchKit takes care of drawing the table while the user scrolls. Even though under watchOS 2 the processing for the app is happening on the watch device itself, this API was built to accommodate the previous OS paradigm.
What does this mean for the performance of your app? For one, you should be very careful to limit the number of rows in your table. Your code right now simply uses the runs array to determine the number of rows. For this app that’s probably fine at first, but what happens if a user runs every day, religiously, using your app for, say, five years, and is still using his first-gen Apple Watch? Now you’d have almost 2,000 runs to deal with at once. Chances are your user won’t need access to all of his runs. It might be smart to limit the number of runs you display at once to 25 or 50. That way, the user can still see relevant, timely data, but you don’t spend a lot of his time (and battery life) on rendering content he’s probably never going to look at. Think about cases like this and try to minimize the amount of work the watch needs to do, and your users will thank you for it.
18.119.160.42