For example,
CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
[rotate setToValue:@(M_PI)];
[rotate setDuration:0.1f];
[[aView layer] addAnimation:rotate forKey:@"myRotationAnimation"];
where M_PI
is defined as a macro in math.h
,
#define M_PI 3.14159265358979323846264338327950288 /* pi */