Category "indexpath"

How to check if IndexPath is valid?

Prior to swift 3, i used to use for example: let path = self.tableView.indexPathForSelectedRow if (path != NSNotFound) { //do something } But now, since i u

How to prevent a UITableViewCell from moving (Swift 5)

This is actually a two part question. First take a look at the code: //canEditRowAt func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath)