Building and Maintaining the Table

All the code in the interface controller is concerned with constructing the table based on the content of the DisplayedCityInfoModel and the WatchKit extension’s copy of the weather model and keeping it up to date with changes in either of those models. Here’s the overall plan:

  • We’ll build the initial set of table rows when the controller’s awakeWithContext() method is called. Because the extension may not have been active for some time (or at all, if this is the first time the user has started the WatchKit app), some or all of the weather data that is available may not be current, so we’ll request updated data if necessary.
  • When the interface controller is activated, we’ll check whether the table is still ...

Get Learn WatchKit for iOS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.