I attempted to infinitely pulse a gradient from transparent to opaque using UIView's block animation. The final result is the gradient remains at full opacity with no animation. Is it even possible to animate CALayer's with the block style or must I use old-school series of statements?
_pulsingLight = [CAGradientLayer layer];
_pulsingLight.colors = @[(id)([UIColor colorWithWhite:1.0 alpha:kPulsingLightStartAlpha].CGColor),
(id)([UIColor colorWithWhite:1.0 alpha:kPulsingLightStopAlpha].CGColor)];
_pulsingLight.opacity = 0.0;
[self.layer insertSublayer:_pulsingLight below:_anotherView.layer];
[UIView animateWithDuration:kPulsingLightHalfLife
delay:0.0
options:UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse
animations:^{
_pulsingLight.opacity = 1.0;
}
completion:nil];