I am using the attached prototype cell layout in a tableview. Each cell is sized using autolayout:
tableView.rowHeight = UITableViewAutomaticDimension
The "tagline" is a string and sets the height of the cell depending on the length of the string. Given a greater length the height of the UIImageView also resizes. The ImageView is set to a variety to images with different sizes and aspect ratios. I would like to resize the image based on the beginning width of the ImageView(that does not change) and the resulting height and the image's aspect ratio.
The code to set the two is very straightforward.
cell.taglineLabel.text = tagline cell.recipeImageView.image = image
Inside a tableView cellForRowAt function I set the tagline first in the code, then the Image. However, if I attempt to resize the image and I inspect the bounds or frame size, the size is the original size. I am assuming the autosize is performing after the func. Therefore, I cannot determine size.
Is there a way to force the autosize after the tagline is set, so I can see the frame/bounds sizes I have to work with?