title: iOS 11 UITableView performBatchUpdates completion closure not being called
body: <p>I have a <code>UITableView</code> which is displaying an aggregated feed of posts from several RSS feeds. Whenever my app pulls new posts from a feed, I create an object representing all of the needed insertions and deletions needed to update the <code>UITableView</code> current rows.  I place these objects into an array which I use as a FIFO queue.  Every few seconds, I pull the first element out of this array and attempt to perform all of the insertions and deletions within the <code>UITableView</code> using the function <code>UITableView:performBatchUpdates</code>.</p>
  
  <p>This all works great ... so long as the user doesn't scroll the <code>UITableView</code> up and down.  If there is scrolling going on, the updates will cease, because I am setting a flag to ensure that I always wait until the last set of insertions/deletions has completed before I start the next batch, and sadly, sometimes, the completion closure of <code>UITableView:performBatchUpdates</code> never gets called, hence my flag is never cleared.</p>
  
  <p>Here is the code I'm using to process my incoming queue of changes for the <code>UITableView</code>:</p>
  
  <pre><code>@objc func updateFeedPostsTableView() {
  
      guard feedUpdateQueue.count &gt; 0,
            !feedTableUpdateInProgress else { return }
  
      feedTableUpdateInProgress = true
      let feedUpdate = feedUpdateQueue.first!
      feedUpdateQueue.remove(at: 0)
  
      self.aggregatedRSSFeed = feedUpdate.feed
  
      self.feedPostsTableView.performBatchUpdates ({
          self.feedPostsTableView.deleteRows(at: feedUpdate.indexPathsOfDeletedPosts,
                                             with: .fade)
          self.feedPostsTableView.insertRows(at: feedUpdate.indexPathsOfNewPosts,
                                             with: .top)
          },
          completion: { (success) in
              self.feedTableUpdateInProgress = false
          }
      )
  }
  </code></pre>
  
  <p>My question is, why would <code>UITableView.performBatchUpdates</code> ever fail to call its completion block?  What am I doing wrong here?</p>
  
  <p>This is iOS 11.2, using Xcode version 9.2.</p>
  
  <p>Thanks!</p>