Typically, a watch user interface will present information to the user or let them select or manipulate it in some way. When items are presented in a table, then it is natural to let the user tap on the row to show a subsequent screen. Watch applications use segues to move from one screen to another in a similar way to iOS applications.
The first step will involve creating a new controller file called RepositoryListController.swift
. This will be used to hold the RepositoryListController
and RepositoryRowController
classes, in a very similar way to the existing InterfaceController
. As with the other view, there will be a table to store the rows, and each row will have a name
label:
class RepositoryRowController: NSObject { @IBOutlet weak var name: WKInterfaceLabel! } class RepositoryListController: WKInterfaceController { let delegate = WKExtension.sharedExtension().delegate as! ExtensionDelegate @IBOutlet weak var repositoriesTable: WKInterfaceTable! }