Last active
June 14, 2018 19:26
-
-
Save litoarias/bb11ad4f09a1a9eeb37ac287a4887a7e to your computer and use it in GitHub Desktop.
Watch Tutorial - 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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