I have 200px x 200px UIImageViewon UICollectionViewCellwhich will display an image from a URL. The problem is that I don’t know which resolution image is provided by the URL, and I think it’s better to resize it first before putting it in UIImageViewdue to memory consumption.
I already use alamofire to upload the image
let url = NSURL(string: "http:\(product.picUrl)")
self.imgProductItem.af_setImageWithURL(url!, placeholderImage: UIImage(named: "app_default-resize"))
I am wondering if there is any method for changing it first before using it in UIImageView? And if there are any tips on loading an image to save memory, I would love to hear that.
Any help would be greatly appreciated. Thank.
source
share