根据自己项目需求来要使用哪一种删除cell
第一种使用方式:
if let _indexPath = indexPath{
let section: TableSection = (self?.tableView.sections.first)!
section.remove(rowAt: _indexPath.row)
self?.tableView.reloadData()
}
第二种使用方式:
if let indexPath = self?.selectIndexPath{
let section: TableSection = (self?.tableView.sections.first)!
section.remove(rowAt: indexPath.row)
UIView.performWithoutAnimation {
self!.show(message: "已移出小黑屋")
if indexPath.row == 0
{
self?.tableView.reloadData()
}
else
{
self?.tableView.deleteRows(at: [indexPath] , with: .none)
}
}
}