swift - How can numberOfRowsInSection function of TableView return multiple values for the same section? -


enter image description herehere, have tableview 1 section. however, have 2 cells. want numberofrowsinsection return 2 different values different rows of same section. but, can't access row in numberofrowsinsection function. can please tell me how attain this?

enter image description here

numberofrowsinsections should return count of cells in section, if want display 2 different type of cell (ex. celltype1 , celltype2), should logic inside

- (uitableviewcell *)tableview:(uitableview *)tableview      cellforrowatindexpath:(nsindexpath *)indexpath{     if (indexpath.section == 0) {        if(indexpath.row == 0){ return celltype1; }        if (indexpath.row == 1) { return celltype2; }     } } 

you can't return multiple values method, apple has not written method return multiple values


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -