You can set it at the same time as you add your animation, but you'll need to supply a fromValue
to the animation to stop it updating the presentation layer immediately:
for(int x = 0; x < viewsArray.count; x++)
{
UIView *view = [viewsArray objectAtIndex:x];
NSString *keyPath = @"transform.rotation.y";
NSNumber *toValue = [NSNumber numberWithFloat:DEGREES_RADIANS(-55.0f)];
CABasicAnimation *startAnimation = [CABasicAnimation animationWithKeyPath:keyPath];
[startAnimation setFromValue:[view.layer valueForKeyPath:keyPath]];
//[startAnimation setToValue:toValue]; We don't need to set this as we're updating the current value on the layer instead.
[startAnimation setDuration:5.0];
[view.layer addAnimation:startAnimation forKey:@"rotate"];
[view.layer setValue:toValue forKeyPath:keyPath]; // Update the modal
}