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,
More simplified solution (add Notification observer when textView is changed), Swift-version. Main trick is using UIView.setAnimationsEnabled
.
func textViewDidChanged(notification: NSNotification) {
UIView.setAnimationsEnabled(false)
let contentOffset = self.tableView.contentOffset
tableView.beginUpdates()
tableView.endUpdates()
tableView.contentOffset = contentOffset
UIView.setAnimationsEnabled(true)
}