For Swift 3.0
override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(true) if self.yourTableView.indexPathForSelectedRow != nil { self.yourTableView.deselectRow(at: self.yourTableView.indexPathForSelectedRow!, animated: true) } }
This code will avoid Failure as well ...
Also, add the following line to another ViewController that you click when you select TableViewCell.
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
Works like a Charm =]
Hope this helps.
Yash bedi
source share