You can use SDWebImage or Kingfisher to show placeholder image and for caching...
Then in its completion block write a code to resize the imageView
@IBOutlet weak var yourImageView: UIImageView!
func loadImage(){
SDWebImageManager.sharedManager().downloadImageWithURL(imgURL, options: SDWebImageOptions.CacheMemoryOnly, progress: { (received, expected) -> Void in
}) { (theImage : UIImage!, error : NSError!, cacheType : SDImageCacheType!, bool : Bool, imageUrl : NSURL!) -> Void in
let aspect = theImage.size.width / theImage.size.height
self.aspectConstraint = NSLayoutConstraint(item: self.yourImageView, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: self.yourImageView, attribute: NSLayoutAttribute.Height, multiplier: aspect, constant: 1.2)
self.yourImageView.image = theImage
}
}//loadImage
var aspectConstraint: NSLayoutConstraint? {
willSet {
if((aspectConstraint) != nil) {
self.yourImageView.removeConstraint(self.aspectConstraint!)
}
}
didSet {
if(aspectConstraint != nil) {
self.yourImageView.addConstraint(self.aspectConstraint!)
}
}
}
Hope this helps.