Changing WKInterfaceTable cells types

125 views Asked by At

I need to display three different kinds of cells in my WatchKit app. Basically a multiliner to report the results, and two singleliners to report either errors or a waiting spin. I am going by trial and error by using an assortment of setNumberOfRows and of setRowTypes, occasionally getting a crash, or conversely not being able to display the needed data and not quite understanding why those things happen. Apple is very stingy in the description by just saying to use setNumberOfRows when you have just a single type and setRowTypes when you have several. She is instead totally silent about how to change the type contents of the table, what would be done on iOS with reloadData. How is it possible to change the composition of the row types in the table in the best possible way?

1

There are 1 answers

0
Aciive On

You can use this function to insert a different row type to your table.

myTable.insertRows(at: NSIndexSet(index: positionOfTable) as IndexSet, withRowType: "newRowType")