我想添加一个长按到 indexPathforSelectedRow 的单元格。当我长按一个单元格时,我希望它会自动添加到 indexPathForSelectedRow 中……我该怎么做?
此代码是长按功能:
func longPress(longPressGestureRecognizer: UILongPressGestureRecognizer) {
if longPressGestureRecognizer.state == UIGestureRecognizerState.Ended {
let touchPoint = longPressGestureRecognizer.locationInView(self.view)
if let indexPath = tableView.indexPathForRowAtPoint(touchPoint) {
let cellToDeSelect:UITableViewCell = tableView.cellForRowAtIndexPath(indexPath)!
//then how?
}
}
}