私のUITableView
場合、メソッドを使用して最後のセルにスクロールします。
WLNetworkClient.sharedClient().createCommentWIthText(commentTextView.text, forItem: item) { error in
defer {
UIAlertController.showAlertFromError(error)
}
if error == nil {
self.fetchedResultsController.fetchRequest.fetchLimit += 1
try! self.fetchedResultsController.performFetch()
self.tableView.reloadData()
self.scrollTableViewToBottom()
}
}
private func scrollTableViewToBottom() {
tableView.scrollToRowAtIndexPath(NSIndexPath(forRow: fetchedResultsController.fetchedObjects!.count - 1, inSection: 0), atScrollPosition: UITableViewScrollPosition.Bottom, animated: true)
}
しかし、これは期待どおりに機能しません.2番目のセルにいる場合でも常にテーブルが上からスクロールされるためです。これを修正する方法は?