In my tableView cell, I have a textView whose string i'm getting via JSON and updating the cell height dynamically like this
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
return 255
}
return UITableViewAutomaticDimension
}
Here's a screenshot
Now initially i want text view to show a little text and upon clicking see more button it should expand and upon expansion the button text should change to see less also if the string's length is just a couple of lines, the see more button should hide. The solution's i've came across involve UILabel
and i can't use it because then the cell's height won't become dynamic. Also there's no property of textView like numberOfLines
so i can work with it. Please point me in a right direction what should i do.