Rolagem irregular após a atualização do UITableViewCell no local com UITableViewAutomaticDimension

Estou criando um aplicativo que possui uma visualização de feed para postagens enviadas pelo usuário. Essa visão tem umUITableView com um costumeUITableViewCell implementação. Dentro desta célula, eu tenho outraUITableView para exibir comentários. A essência é algo como isto:

Feed TableView
  PostCell
    Comments (TableView)
      CommentCell
  PostCell
    Comments (TableView)
      CommentCell
      CommentCell
      CommentCell
      CommentCell
      CommentCell

O feed inicial será baixado com três comentários para visualização, mas se houver mais comentários ou se o usuário adicionar ou excluir um comentário, desejo atualizar oPostCell no lugar dentro da visualização da tabela de feeds adicionando ou removendoCommentCells para a tabela de comentários dentro doPostCell. Atualmente, estou usando o seguinte auxiliar para fazer isso:

// (PostCell.swift) Handle showing/hiding comments
func animateAddOrDeleteComments(startRow: Int, endRow: Int, operation: CellOperation) {
  let table = self.superview?.superview as UITableView

  // "table" is outer feed table
  // self is the PostCell that is updating it's comments
  // self.comments is UITableView for displaying comments inside of the PostCell
  table.beginUpdates()
  self.comments.beginUpdates()

  // This function handles inserting/removing/reloading a range of comments
  // so we build out an array of index paths for each row that needs updating
  var indexPaths = [NSIndexPath]()
  for var index = startRow; index <= endRow; index++ {
    indexPaths.append(NSIndexPath(forRow: index, inSection: 0))
  }

  switch operation {
  case .INSERT:
    self.comments.insertRowsAtIndexPaths(indexPaths, withRowAnimation: UITableViewRowAnimation.None)
  case .DELETE:
    self.comments.deleteRowsAtIndexPaths(indexPaths, withRowAnimation: UITableViewRowAnimation.None)
  case .RELOAD:
    self.comments.reloadRowsAtIndexPaths(indexPaths, withRowAnimation: UITableViewRowAnimation.None)
  }

  self.comments.endUpdates()
  table.endUpdates()

  // trigger a call to updateConstraints so that we can update the height constraint 
  // of the comments table to fit all of the comments
  self.setNeedsUpdateConstraints()
}

override func updateConstraints() {
  super.updateConstraints()
  self.commentsHeight.constant = self.comments.sizeThatFits(UILayoutFittingCompressedSize).height
}

Isso realiza a atualização muito bem. A postagem é atualizada no local com comentários adicionados ou removidos dentro doPostCell como esperado. Estou usando o dimensionamento automáticoPostCells na tabela de feeds. A tabela de comentários doPostCell expande para mostrar todos os comentários, mas a animação é um pouco irregular e a tabela meio que rola para cima e para baixo uma dúzia de pixels ou mais, enquanto a animação de atualização da célula ocorre.

O salto durante o redimensionamento é um pouco chato, mas meu problema principal vem depois. Agora, se eu rolar para baixo no feed, a rolagem será suave como antes, mas se rolar acima da célula que acabei de redimensionar após adicionar comentários, o feed retrocederá algumas vezes antes de chegar ao topo do feed. ConfigureiiOS8 células de dimensionamento automático para o Feed como este:

// (FeedController.swift)
// tableView is the feed table containing PostCells
self.tableView.rowHeight = UITableViewAutomaticDimension
self.tableView.estimatedRowHeight = 560

Se eu remover oestimatedRowHeight, a tabela apenas rola para o topo sempre que a altura da célula é alterada. Estou me sentindo bastante preso a isso agora e, como um novo desenvolvedor do iOS, poderia usar qualquer dica que você possa ter.

questionAnswers(6)

yourAnswerToTheQuestion