longPressed セルを 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?
}
}
}