Skip to content

Instantly share code, notes, and snippets.

@Marcocanc
Created February 20, 2017 13:41
Show Gist options
  • Save Marcocanc/8c35f1299ea4501838dcf795a11c863e to your computer and use it in GitHub Desktop.
Save Marcocanc/8c35f1299ea4501838dcf795a11c863e to your computer and use it in GitHub Desktop.
deselect any UITableViewRow that may be selected
extension UITableView {
//deselect any row that may be selected
public func deselectAnyRow(animated: Bool = true) {
if let indexPath = self.indexPathForSelectedRow {
self.deselectRow(at: indexPath, animated: animated)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment