ios - TableView 滑动删除 : How to Programmatically Un-swipe

标签 ios swift uitableview

我在表格 View 中使用滑动删除功能来删除选定的单元格。您将其向左滑动以显示删除按钮。我的代码运行良好,可以正常删除。

我还包含了一个 UIAlertController,为应用程序的用户提供最后一次避免犯错的机会。我想做的是,如果用户选择“取消”是让单元格“取消滑动”并返回到其原始位置。有办法做到这一点吗?

最佳答案

你可以在tableView上关闭编辑

[self.tableView setEditing:NO animated:YES];

关于ios - TableView 滑动删除 : How to Programmatically Un-swipe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32078293/

相关文章:

iphone - 关于 SQLite3 和更新 iPhone 应用程序的问题

swift - 在子类中初始化属性委托(delegate)

ios - 如何添加带有两个按钮的单元格

ios - 从单元格行获取 UITableViewCell 属性

iphone - 带有 unicode 文本的 UILabel 过多

ios - React Native "___cxa_increment_exception_refcount"的 Xcode 构建错误

iOS推送通知: how to store push notification payload when application is kill or terminate in swift?

ios - 在 Swift 中单击 TableView 的单元格时如何调用(显示)另一个 View Controller

swift - 根据运行时 UISegmented 控件的选择隐藏标签

ios - UITableView 中具有动态高度的可拉伸(stretch)标题 View