title: How to avoid flicker when reloading expandable table view cells?
body: <p>I need the cells of a <code>UITableView</code> to be expanded, but I see a flicker when doing this.</p>
  
  <p>I have this implementation:</p>
  
  <pre><code>func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  
      // Switch row state
      expandedFlags[indexPath.row] = !expandedFlags[indexPath.row]
  
      UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseOut, animations: { () -&gt; Void in
              tableView.beginUpdates()
              tableView.reloadRows(at: [IndexPath(row: indexPath.row, section: 0)], with: UITableViewRowAnimation.automatic)
              tableView.endUpdates()
          }, completion: nil)
  }
  </code></pre>
  
  <p>Is there any way to avoid the flicking when reloading the cells? I've read several posts but didn't work for my scenario.</p>