Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户滑动单元格时,我会显示一些选项。一切正常,当用户滚动时,表格滑动选项关闭。当我在数据更改时重新加载表时,我想要相同的行为。如何实现。如果用户滑动了单元格并且我重新加载了表格,则滑动选项仍然存在。
您隐藏刷过的单元格,只需在重新加载表格视图之前添加这行代码。
tableView.setEditing(false, animated: true)
现在为了启用编辑,在你的 cellForAtIndex Path 函数中进行如下检查
if indexPath.row == array.size { tableView.setEditing(true, animated: true) }