Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Watchkit: table with two templates in dynamic rows

How to instantiate two different templates of dynamic row in WKInterfaceTable? For only one template I use functions

 [self.stocksTable setNumberOfRows: self.stocksData.count withRowType:@"TableRow"];
 TableRow *row = [self.stocksTable rowControllerAtIndex:i];

Question: How to have 2 types of row?

like image 675
vitalii Avatar asked Nov 27 '14 19:11

vitalii


1 Answers

You want -[WKInterfaceTable setRowTypes:]:

[self.myTable setRowTypes:@[@"RowType1", @"RowType2"]];
MyRowType1Controller *row1 = [self.myTable rowControllerAtIndex:0];
MyRowType2Controller *row2 = [self.myTable rowControllerAtIndex:1];
like image 169
Dave DeLong Avatar answered Nov 02 '22 09:11

Dave DeLong