UITableView Extension to Deselect Selected Row

Nothing fancy. Just a tiny little extension method that makes doing this in Swift slightly nicer.

import UIKit

public extension UITableView {

    public func deselectSelectedRowAnimated(animated: Bool) {
        if let indexPath = indexPathForSelectedRow() {
            deselectRowAtIndexPath(indexPath, animated: animated)
        }
    }

}
Collin Donnell @collin