Swift - Dynamic UITableViewCell size based on image aspect ratio
I'm trying to create dynamically sized UITableViewCells, changing the height based on the aspect ratio of an image downloaded from a server. For example, if an image's height is double its width, I want the UITableViewCell's height to be double the screen width so that the image can take up the full width of the screen and maintain the aspect ratio. What I've tried to do is add constraints to the cell and use UITableViewAutomaticDimension to calculate the height, but the problem I'm facing is that I cannot know the aspect ratio of the image until it is downloaded, and therefore the cells start