title: Selecting and Deselecting UITableViewCells - Swift
body: <p>Currently I am able to tap a cell and select it using <code>didSelectRowAtIndexPath</code>. However, I am unable to deselect it when tapped. I wish to toggle these two features.</p>
  
  <pre><code>func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
  
  
      var selectedCell = tableView.cellForRowAtIndexPath(indexPath)!
      selectedCell.backgroundColor = UIColor.purpleColor()
  
      tableView.deselectRowAtIndexPath(indexPath, animated: true)
  
  }
  </code></pre>
  
  <ul>
  <li>I have a <code>TableView</code> in my <code>View Controller</code>.</li>
  <li>The <code>dataSource</code> and <code>delegate</code> are already set up.</li>
  <li>Multiple selection is enabled in <code>UIBuilder</code> for the table.</li>
  </ul>