title: UIButton position issue on CGAffineTransformScale of parent view
body: <p>I have a <code>UIView</code> that I scale, pan and rotate with a <code>UIButton</code> added to it as subview at <code>(0,0)</code> with width and height of <code>50px</code>.</p>
  
  <p>This button acts as a trigger for an editing functionality. The problem I'm having is that when I scale the <code>UIView</code> using <code>UIPinchGestureRecognizer</code> added to the <code>UIView</code> such that it shrinks, I invert the transform on the <code>UIButton</code> so that its size stays constant.</p>
  
  <p>However due to the <code>UIView</code> scale changing, it results in the <code>UIButton</code> frame extending outside the parent <code>UIView</code>. This renders part of the button unclickable. I would like to have the button stay within the parent <code>UIView</code>, fixed at its origin at all times like when it was added, how do I go about doing this?</p>
  
  <p>I've added the <code>UIPinchGestureRecognizer</code> handler code below.</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>- (void)scaleView:(UIPinchGestureRecognizer*)recognizer {
  
      recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
  
      self.editBtn.transform = CGAffineTransformInvert(recognizer.view.transform);
  
      recognizer.scale = 1;
  }
  </code></pre>