title: UITableViewCell animation is hit or miss. Sometimes table data/cells just pop in without the animation
body: <p>So I'm using a custom animation for how the table cells appear. They sort of fade in and slide up a little. I'm populating the table with data from an API call.</p>
  <p>What I'm noticing is that it doesn't always happen. Sometimes it works as expected, other times the cells/data just appear abruptly, no animation/movement. They just sort of pop in at what would would be the end of the animation. I don't really see any consistent pattern in when it works and when it doesn't. Seems pretty random.</p>
  <p>Any idea what is causing this behavior?</p>
  <p>Here's the code for the animation and where it is in the tableview function:</p>
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      
      var cell: RecentActivityCell = recentActivityView.dequeueReusableCell(withIdentifier: &quot;cellId&quot;, for: indexPath) as! RecentActivityCell
      
      var lastInitialDisplayableCell = false
  
          //change flag as soon as last displayable cell is being loaded (which will mean table has initially loaded)
      if userActivityArray.count &gt; 0 &amp;&amp; !finishedLoadingInitialTableCells {
              if let indexPathsForVisibleRows = tableView.indexPathsForVisibleRows,
                  let lastIndexPath = indexPathsForVisibleRows.last, lastIndexPath.row == indexPath.row {
                  lastInitialDisplayableCell = true
              }
          }
  
          if !finishedLoadingInitialTableCells {
  
              if lastInitialDisplayableCell {
                  finishedLoadingInitialTableCells = true
              }
  
              //animates the cell as it is being displayed for the first time
              cell.transform = CGAffineTransform(translationX: 0, y: 40/2)
              cell.alpha = 0
  
              UIView.animate(withDuration: 0.5, delay: 0.05*Double(indexPath.row), options: [.curveEaseInOut], animations: {
                  cell.transform = CGAffineTransform(translationX: 0, y: 0)
                  cell.alpha = 1
              }, completion: nil)
          }
      
      cell.backgroundColor = UIColor.clear
      
      if userActivityArray[indexPath.row].status == &quot;Success&quot; {
          cell.statusImage.image = UIImage(named: &quot;passImage&quot;)
      } else {
          cell.statusImage.image = UIImage(named: &quot;failImage&quot;)
      }
      
      cell.activity = userActivityArray[indexPath.row]
      return cell
  }
  </code></pre>