Hello I have a UITableView with x# of cells. the last cell I have two UILabels. When the second UILabel text is set I am trying to get the cell and the UILabel to resize to sh
here are the steps ...
hope you know about autylayout
. use constraints (left to content view
, right to content view
, bottom to content view
and verticle to your first label
)
then in your viewdidLoad
method add YourTableView.estimatedRowHeight = 200
-> give any height you want.
finally define below method :
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
you good to go.