Im facing a problem while setting up UITextview
in UITableViewCell
. As the function heightforrowatindexpath is running before cellforrowatindexpath so I cannot calculate the size of content of UITextview
.
Im calculating the size by simply textview.contentSize.height
in cellforrowatindexpath
function.
Im basically want UITextview
contentHeight fit in UITableViewCell
so no scroll is visible for every UITextView
and it will show full content by increasing the height of UITableViewCell
.
I also a UILabel
just above the UITextView
in UITableViewCell
and I tried to set contraints for both but unable to achieve my goal.
How can I calculate the size of UITableViewCell
dynamically in following function:
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
}
P.S: Is it possible to use increase the UITableViewCell
height a little bit according to device height, using auto layout or some technique else.