I want to add a cell that longPressed to indexPathforSelectedRow.. when I longPress a cell, I hope it would be added automatically in indexPathForSelectedRow... how can I do it?
This code is long press function:
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?
}
}
}