title: Core Animation - animationDidStop not called
body: <p>there.</p>
  
  <p>in iOS app, Core animation callback don't work.</p>
  
  <pre><code>- (void)startAnim {
      CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
      anim.fromValue = startAngle;
      anim.toValue = endAngle;
      anim.duration = 2;
      anim.delegate = self;
  
      [self.target addAnimation:anim forKey:nil];   // self.target is CALayer instance, it's sublayer of Custom UIView
  }
  
  - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag {
     [self.target setValue:@(endAngle) forKeyPath:@"transform.rotation.z"];
  }
  </code></pre>
  
  <p>But animationDidStop never be called.
  If I change the code like as following, completion blocked is called.</p>
  
  <pre><code>- (void)startAnim {
      CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
      anim.fromValue = startAngle;
      anim.toValue = endAngle;
      anim.duration = 2;
      anim.delegate = self;
  
      [CATransaction begin];
      [CATransaction setCompletionBlock:^{
          [self.target setValue:@(endAngle) forKeyPath:@"transform.rotation.z"];
      }];
  
      [self.target addAnimation:anim forKey:nil];
      [CATransaction commit];
  }
  </code></pre>
  
  <p>But I don't want to use CATransaction.
  Why is not animationDidStop called?</p>
  
  <p><strong>Update:</strong>
  There is a way to set final value like as</p>
  
  <pre><code>- (void)startAnim {
      CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
      anim.fromValue = startAngle;
      anim.toValue = endAngle;
      anim.duration = 2;
      anim.delegate = self;
  
      [self.target setValue:@(endAngle) forKeyPath:@"transform.rotation.z"];
      [self.target addAnimation:anim forKey:nil];
  }
  </code></pre>
  
  <p>But final assignment should be done when the animation is finished. Because there are multiple dynamic animations of layer, so I don't know final value.</p>