在UITableViewCell上向右滑动
问题描述:
所以我已经在网站上搜索了这个问题的答案,并且有一些体面的结果,但是自从XCode 7不再处于测试阶段以来,并没有什么近期的结果,而现在Swift 2.0已经成为标准。在UITableViewCell上向右滑动
我用下面的代码,以便让这个一个“向左滑动”功能会导致一些事情发生到一个UITableViewCell -
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath){
if editingStyle == UITableViewCellEditingStyle.Delete {
....
}
}
我明白这是什么,苹果现在提供在他们的API和使用外部类是不需要的。
我也明白,你可以使用这个本地代码定义,从这个轻扫拿出行动:
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {
let more = UITableViewRowAction(style: .Normal, title: "More") { action, index in
print("more button tapped")
}
我的问题是,是否有任何也是本地代码(的iOS 9.0以上版本,迅速2.0),这将在UITableViewCell上定义一个“正确的滑动”?
谢谢你提前!
可能重复的[在iOS9中Swipe-able表格视图单元格或Swift指南至少?](http://stackoverflow.com/questions/32004557/swipe-able-table-view-cell-in-ios9-or -swift指南至少) –
尝试自定义刷卡删除https://github.com/MortimerGoro/MGSwipeTableCell – NANNAV
@NANNAV是啊看起来像这是唯一的方法来完成它 – hnaderi