I have a UIImageView
in storyboards with an initial image with AspectFit.
I want to know how I can switch between images with animation but also make this new image have the same aspectFit property as the one loaded through storyboards initially.
This is my code which switches the images but it does not have AspectFit to it. The image looks really small.
func switchImages(){
let toImage = UIImage(named:"Unlock")
UIView.transitionWithView(self.myImageView,
duration:2,
options: UIViewAnimationOptions.TransitionCrossDissolve,
animations: {self.myImageView.image = toImage},
completion: nil)
}