title: CAShapeLayer Path Animation
body: <p>I'm trying to animate a path change on a particular shape. I can manually change without animation by replacing this code with a simple .path [cgpath] setter. However, I want to animate the change for aesthetics. </p>
  
  <p>When this code executes, there is no change to the shape what-so-ever although the log suggests the animation is complete.</p>
  
  <pre><code>for (CALayer *layer in self.view.layer.sublayers) {
      if ([layer isKindOfClass:[CAShapeLayer class]]) {
          CAShapeLayer *copy = (CAShapeLayer *)layer;
          if ([sideChoice isEqualToString:@"datum"]) {
              if ([copy.name isEqualToString:@"datumSideLayer"]) {
                  [CATransaction begin];
                  [CATransaction setCompletionBlock:^{
                      NSLog(@"Animation complete.");
                  }];
                  CABasicAnimation *morph = [CABasicAnimation animationWithKeyPath:@"path"];
                  morph.duration = 1;
                  morph.toValue = pathChange;
                  [copy addAnimation:morph forKey:nil];
  
                  [CATransaction commit];
                  break;
              }
          } else if ([sideChoice isEqualToString:@"opposite"]) {
              if ([copy.name isEqualToString:@"oppositeSideLayer"]) {
  
              }
          }
      }
  }
  </code></pre>