title: Same CGAffineTransform different anchor
body: <p>I have 1 view with 2 subviews. One of them being 10 times bigger than the other one. I have a gesture recognizer for the big one (which is on top).</p>
  
  <p>I want to be able to scale the big one with the pinch gesture from an anchor point between the fingers. And I want the little one to make that same transform from the same global position anchor point but <strong>without changing its own anchor point.</strong></p>
  
  <p>Hope I explain myself. Here is the code:</p>
  
  <pre><code>- (void)twoFingerPinch:(UIPinchGestureRecognizer *)gestureRecognizer
  {    
      //this changes the anchor point of "big" without moving it
      [self adjustAnchorPointForGestureRecognizer:gestureRecognizer];
  
      if ([gestureRecognizer state] == UIGestureRecognizerStateBegan || [gestureRecognizer state] == UIGestureRecognizerStateChanged) {    
  
          CGAffineTransform transform = CGAffineTransformScale([[gestureRecognizer view] transform], [gestureRecognizer scale], [gestureRecognizer scale]);
          float scale = sqrt(transform.a*transform.a+transform.c*transform.c);
  
          //this transforms "big"
          [gestureRecognizer view].transform = transform;
  
          //anchor point location in little view
          CGPoint pivote = [gestureRecognizer locationInView:little];
  
          CGAffineTransform transform_t = CGAffineTransformConcat(CGAffineTransformMakeTranslation(-pivote.x, -pivote.y), transform);
          transform_t = CGAffineTransformConcat(transform_t, CGAffineTransformMakeTranslation(pivote.x, pivote.y));
  
          little.transform = transform_t;
      }
      [gestureRecognizer setScale:1];
  }
  </code></pre>
  
  <p>But this is not working, the little view keeps jumping around and goes crazy.</p>
  
  <p>EDIT: More info.</p>
  
  <p>Ok, this is the diagram: <img src="https://i.stack.imgur.com/xLWtV.jpg" alt="diagram"></p>
  
  <p>The red square is the big view, the dark one is the little one. The dotted square is the main view.</p>
  
  <p>The line: [self adjustAnchorPointForGestureRecognizer:gestureRecognizer]; changes the big views anchor point to the center of the pinch gesture. That works.</p>
  
  <p>As I scale the big view, the small view should scale the same amount and move so it's centered in the big view as it is now. That is, it should scale with the same anchor point as the big view.</p>
  
  <p>I would like to keep those transforms to the little view in a CGAffineTransform, if possible.</p>