// // InterfaceController.swift // BlueWalletWatch Extension // // Created by Marcos Rodriguez on 3/6/19. // import WatchKit import WatchConnectivity import Foundation class InterfaceController: WKInterfaceController { @IBOutlet weak var walletsTable: WKInterfaceTable! @IBOutlet weak var noWalletsAvailableLabel: WKInterfaceLabel! override func willActivate() { super.willActivate() updateUI() NotificationCenter.default.addObserver(self, selector: #selector(updateUI), name: Notifications.dataUpdated.name, object: nil) } @objc private func updateUI() { let wallets = WatchDataSource.shared.wallets let isEmpty = wallets.isEmpty noWalletsAvailableLabel.setHidden(!isEmpty) walletsTable.setHidden(isEmpty) if isEmpty { return } walletsTable.setNumberOfRows(wallets.count, withRowType: WalletInformation.identifier) for index in 0.. Any? { return rowIndex } }