ios - Re-Order UITableView Sections only -


i have been trying find way re-oder table sections drag , drop re-ordering table rows no success. can guide me go? need re order complete section not rows.

simple way standard delegate methods

  • implement tableview:moverowatindexpath:toindexpath:
    data represents data source array containing sections.

    func tableview(tableview: uitableview, moverowatindexpath sourceindexpath: nsindexpath, toindexpath destinationindexpath: nsindexpath) {    let itemtomove = data[sourceindexpath.section]    data.removeatindex(sourceindexpath.section)    data.insert(itemtomove, atindex: destinationindexpath.section)    tableview.reloaddata()  } 
  • set editing of table view true. reorder symbol appears.

  • drag row. code in method moverowatindexpath reorders entire section.

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -