title: CGAffineTransform and scaling to center of the image
body: <p>I started studying objective-c using the <a href="https://rads.stackoverflow.com/amzn/click/com/1430227001" rel="noreferrer" rel="nofollow noreferrer">iPhone and iPad apps for Absolute Beginners by Rory Lewis</a> book but i got stuck on the 5th chapter.</p>
  
  <p><strong>I want to make a button that shrinks an image.</strong><br>
  My problem is, that after I wrote all the code, the image shrinks to the point (0, 0) of the UIImageView (the top left), while in the video the image shrinks to its center. I've done some research and found out that <code>CGAffineTransform</code> uses the center of the object to make translations, rotations etc.</p>
  
  <p>So why does it not work in my case?</p>
  
  <p>I have the latest Xcode version and haven't done anything strange.
  I hope I've been clear. Sorry for my English.</p>
  
  <p><strong>EDIT</strong>
  Sorry for the code, but i wrote the question from my phone.
  Anyway the incriminated part goes something like this</p>
  
  <pre><code>- (IBAction)shrink:(id)sender {
  
  if(hasShrink == NO){
      [shrinkButton setTitle:@"Grow" forState:UIControlStateNormal];
  }
  else if(hasShrink == YES){
      [shrinkButton setTitle:@"Shrink" forState:UIControlStateNormal];
  }
          [UIView beginAnimations:nil context:nil];
          [UIView setAnimationDuration:1.0];
          myIcon.transform = CGAffineTransformMakeScale(.25, .25);
          hasShrink = YES;
          [UIView commitAnimations];
  </code></pre>
  
  <p>}</p>
  
  <p>All the animations are  correctly written and the app does work, it just shrinks to the top left. Why is the point not set to the center of the UIImageView by default like it should be?</p>
  
  <p><strong>EDIT:</strong>
  I figured out it was a problem caused by AutoLayout.
  Once disabled everything went smooth ;)</p>