1

Watch OS 3/Xcode 8 allows for stand alone watch apps. Can someone provide the best Swift array/method for loading data to a table in storbyboard in order from Interface Controller, updating after each display.

My code right now only selects the first value and displays in table, does not move onto the next value in the table list after use.

let financeupdate = ["London", "Milan", "Bangkok", "NYC"}
    loadTableData()
}

private func loadTableData(){
    financetable.setNumberofRows(financeupdate.count, withRowType:"GlobalFinanceRowController")

    for (index, financeupdateName) in enumerate(finaceupdate_ {
        let row=finacetable.rowControllerAtIndes(index) as GlobalFinanceRowController

        row.interfaceLabel.setText(financeName)
    }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

You can view this url to see a tutorial doing same. It has following method where multiple rows are being displayed:

    var flights = Flight.allFlights()

  override func awake(withContext context: Any?) {
    super.awake(withContext: context)
    flightsTable.setNumberOfRows(flights.count, withRowType: "FlightRow")

    for index in 0..<flightsTable.numberOfRows {
      guard let controller = flightsTable.rowController(at: index) as? FlightRowController else { continue }

      controller.flight = flights[index]
    }
  }
pankaj
  • 7,878
  • 16
  • 69
  • 115