I have a UIImageView in cell with default image and size 80x80 and constraints. Then in table view i dynamically load new images with different sizes:
if let url = NSURL(string: currentStoreProduct.productImageUrl) {
if let data = NSData(contentsOfURL: url) {
cell.imageView!.image = UIImage(data: data)
}
}
But when i set this images to my imageView, the images do not fit size of previous. I want to scale this images to current width and height of default image. I tried this:
cell.imageView!.frame = CGRectMake(cell.imageView!.frame.origin.x, cell.imageView!.frame.origin.y, 80, 80)
But it doesn't help.