ios - Move UITableViewCell index in TableView [SWIFT] -


i move uitableviewcell end of array once selected. how change index of uitableviewcell?

var tableviewdata = ["1", "2","3","4"] ...  func tableview(tableview: uitableview!, didselectrowatindexpath indexpath: nsindexpath!){     let myselectedcell:uitableviewcell = tableview.cellforrowatindexpath(indexpath)      // move cell     ... } 

thanks

this should work specific example (note assumes table view has 1 section):

// remove item data array let item = data.removeatindex(indexpath.row) // add item again, @ end of array data.append(item)  // move corresponding row in table view reflect change tableview.moverowatindexpath(indexpath, toindexpath: nsindexpath(forrow: data.count - 1, insection: 0)) 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -