Search code examples
iosobjective-cuiimageviewcgaffinetransform

CGAffineTransformScale doesn't reset


I use this code at viewDidLoad to scale my UIImageView:

imageView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 3.0, 3.0);

Now, I want to go back to its original size, 1.0

I use this action for an UIButton

imageView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.0, 1.0);

But doesn't work. What the problem?


Solution

  • if you just want to scale the size , use CGAffineTransformMakeScale is easy and will solve your problem.