Skip to content

Instantly share code, notes, and snippets.

@litoarias
Last active June 14, 2018 19:26
Show Gist options
  • Save litoarias/bb11ad4f09a1a9eeb37ac287a4887a7e to your computer and use it in GitHub Desktop.
Save litoarias/bb11ad4f09a1a9eeb37ac287a4887a7e to your computer and use it in GitHub Desktop.
Watch Tutorial - 3
class InterfaceController: WKInterfaceController {
// ...
// MARK: - Items Table
private var items = [String]() {
didSet {
DispatchQueue.main.async {
self.updateTable()
}
}
}
/// Updating all contents of WKInterfaceTable
func updateTable() {
table.setNumberOfRows(items.count, withRowType: "Row")
for (i, item) in items.enumerated() {
if let row = table.rowController(at: i) as? Row {
row.lbl.setText(item)
}
}
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment