I got an error swift on xcode7.2
<p>The error tells me "downcast from ‘[NSindexPath]’ only unwraps optionals; did you mean to use ‘!’?" I don't know how to fix this. need your help. </p>

<pre><code>  func deselectAllRows(tableView:UITableView) {

    tableView.reloadData()
      // below is the code I got an error for
    if let selectedRows = tableView.indexPathsForSelectedRows as? [NSIndexPath] {
        for indexPath in selectedRows {
            tableView.deselectRowAtIndexPath(indexPath, animated: false)
        }
    }
}
</code></pre>