Configuring the Content in Tables
Now that we’ve squared away how our row controller is going to behave, we can use it in our RunLogInterfaceController. Unlike UITableView from UIKit, where we’d return the number of rows from a data source method and then configure each row on demand, we’ll set the number of rows manually, then iterate through them and configure them as we go. We’ll also configure our NSFormatter subclasses to do formatting, then pass them to each row controller. We’ll get everything set up in the interface controller’s willActivate method. First, however, we need the data to put in the rows. Create a new class in Swift. Add a new Swift file to our WatchKit extension, and name it Run.swift. In it, create a new class with some ...
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