I'm trying to have a UITableView with several cells types. One of my cells needs to dynamically change his height while typing text in it. Here is the code for change the cell's height (in the cell's class), which works good:
func textViewDidChange(_ textView: UITextView)
{
var newFrame:CGRect = noteTextView.frame
newFrame.size.height = noteTextView.contentSize.height
noteTextView.frame = newFrame
self.frame = CGRect(x: self.frame.origin.x, y: self.frame.origin.y, width: self.frame.width, height: noteTextView.contentSize.height)
}
But the cell is overlaying the cell under him. Nor adding those lines on the parent tableView member helped:
mParentTableView.setNeedsLayout()
mParentTableView.layoutIfNeeded()
Any idea how to tell the tableView recalc its contained cells sizes ?
(XCode 9, Swift 4)