I have a UITextView
in a tableViewCell, and using the iOS 8 provided UITableViewAutomaticDimension
approach listed here.
If user add new line to UITextView
, and so textView, cell height should increase, how can I update height?
Tried:
cell.layoutIfNeeded()
cell.setNeedsUpdateConstraints()
These does not work.
If I reload cell, like
tableView.reloadRowsAtIndexPaths([iindexPath], withRowAnimation: .None)
this works, but then I need to deal with resign and show keyboard. I would avoid it. Any workaround?
need to add following method:
func textViewDidChange(textView: UITextView) {
tableView.beginUpdates()
tableView.endUpdates()
}
it will update constraints without reloading tableview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With