- (nullable id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event
Layer:
-(void)addAnimation:(CAAnimation *)anim forKey:(NSString *)key
{
[super addAnimation:anim forKey:key];
}
View:
+ (Class)layerClass
{
return [XLayer class];
}
[UIView beginAnimations:@"xx" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
pView.frame = CGRectMake(120, 180, 40, 40);
[UIView commitAnimations];