I am using Xcode 8.2.1 with Swift 3. I have one custom UITableViewCell containing a UITextView. When I type into the textView
, the custom cell automatically gro
every time you need update cell use this code:
func updateCellHeight(indexPath: IndexPath, comment: String) {
//update dataModel according to new text
...
//then reload visible tableview rows
//pay atttention to beginUpdates endUpdates methods.
//This do the trick)
tableView.beginUpdates()
tableView.reloadRows(at: indexPathsForVisibleRows ?? [], with: .none)
tableView.endUpdates()
}