【发布时间】:2016-01-07 10:36:40
【问题描述】:
我有一个带有 4 个 UIButtons 的表格单元格视图:
按钮有 Touch Up Inside 事件
@IBAction func increasDealRatingAction(sender:UIButton) {
let buttonPosition = sender.convertPoint(CGPointZero, toView: self.tableView)
if let indexPath = self.tableView.indexPathForRowAtPoint(buttonPosition) {
...
}
}
我对每个单元格都有编辑操作:
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
...
return [addToWishListAction, addToPurchasesAction, deleteAction]
}
问题是,当您向左滑动以显示“添加到愿望清单”、从星形按钮位置“删除”操作、也处理了单击事件或在您滑动按钮区域时未检测到滑动操作。
【问题讨论】:
-
如果您使用的是 UISwipeGestureRecognizer 那么请使用默认的 tableviewSwipe 或者您可以使用第三方库来显示滑动按钮(如 SWTableViewCell)。
标签: ios swift uigesturerecognizer