I'm working with Tableview
in Swift
Now I got an issue with tableview cell height .I'm working on the chat Screen so I have text, Image. so I took one prototype cell within that I'm managing the screen.
Now below is my Code for Height
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if msg_type == "Image" {
return 150
}else if msg_type == "Text"{
return UITableViewAutomaticDimension
}
}
so text cell not getting as I expected, But here I don't know where is my mistake, and one more thing if I return UITableViewAutomaticDimension
it is working fine for Text messages, not images.
Please help me thanks in advance.