title: Anchor Point in CALayer
body: <p>Looking at the Touches example from Apple's documentation, there is this method:</p>
  
  <pre><code>// scale and rotation transforms are applied relative to the layer's anchor point
  // this method moves a gesture recognizer's view's anchor point between the user's fingers
  - (void)adjustAnchorPointForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer {
      if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
          UIView *piece = gestureRecognizer.view;
          CGPoint locationInView = [gestureRecognizer locationInView:piece];
          CGPoint locationInSuperview = [gestureRecognizer locationInView:piece.superview];
  
          piece.layer.anchorPoint = CGPointMake(locationInView.x / piece.bounds.size.width, locationInView.y / piece.bounds.size.height);
          piece.center = locationInSuperview;
      }
  }
  </code></pre>
  
  <p>First question, can someone explain the logic of setting the anchor point in the subview, and changing the center of the superview (like why this is done)?</p>
  
  <p>Lastly, how does the math work for the anchorPoint statement?  If you have a view that has a bounds of 500, 500, and say you touch at 100, 100 with one finger, 500, 500 with the other.  In this box your normal anchor point is (250, 250).  Now it's ???? (have no clue) </p>
  
  <p>Thanks!</p>