ios - how to delete a cell from a UITableView with multi section in swift -
i'm trying delete cell uitableview in swift, follow tutorial: http://www.ioscreator.com/tutorials/delete-rows-table-view-ios8-swift problem uitableview has many section, can't delete cell way tutorial. 1 know how delete cell form table multiple section? thanks.
you cannot delete multiple cells @ once method described in tutorial. work single cell. if select multiple cells , use button, example, trigger delete action, code this:
if let indexpaths = tableview.indexpathsforselectedrows() as? [nsindexpath] { indexpath in indexpaths { // 1 one remove items datasource } tableview.deleterowsatindexpaths(indexpaths, withrowanimation: .automatic) }
Comments
Post a Comment