I have a UITableView with a cell that is dynamically sized to fit a UITextView inside it. Whenever a key is typed, the cell checks to see if the calculated height has increased,
Here is my UITableView extension that works perfectly. In Swift 2.1. Based on the accepted answer.
extension UITableView
{
func reloadDataAnimatedKeepingOffset()
{
let offset = contentOffset
UIView.setAnimationsEnabled(false)
beginUpdates()
endUpdates()
UIView.setAnimationsEnabled(true)
layoutIfNeeded()
contentOffset = offset
}
}