Quiero poder usar una UIViewAnimationCurve para rotaciones y otra para cambios en la posición. es posible?Utilice dos UIViewAnimationCurves diferentes en la misma animación
Por ejemplo (en pseudo código);
// Begin animations
// Set rotation animation curve to EaseInOut
// Set position animation curve to Linear
// Make some changes to position
// Make some change to the angle of rotation
// Commit the animations
EDIT: (enfoque CAAnimationGroup sugiere a continuación) - han creado 2 CABasicAnimations separadas y una CAAnimationGroup sin embargo, las animaciones no están comenzando. ¿Algunas ideas?
CABasicAnimation *postionAnimation = [CABasicAnimation animationWithKeyPath:@"position"];
postionAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
postionAnimation.toValue = [NSValue valueWithCGPoint:[self transformPointToWorldSpaceFromViewSpace:self.spriteView.position]];
postionAnimation.delegate = self;
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.z"];
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
rotationAnimation.toValue = [NSNumber numberWithFloat:self.spriteView.angle -= M_PI_2];
rotationAnimation.delegate = self;
CAAnimationGroup *animationsGroup = [CAAnimationGroup animation];
animationsGroup.duration = self.clockSpeed;
animationsGroup.animations = [NSArray arrayWithObjects:postionAnimation, rotationAnimation, nil];
// Perform the animation
[self.spriteView.layer addAnimation:animationsGroup forKey:nil];
Este es un gran consejo, gracias Duncan. Lo intentaré mañana. Dave –
Hola Duncan, ¡hazlo y trabaja! La única pregunta que tengo es, ¿está bien llamar a mi método [self transformPointToViewSpaceFromWorldSpace: self.spriteView.position] dentro del bloque? Funciona y los instrumentos no muestran ninguna fuga, sin embargo, recuerdo vagamente algo acerca de usar uno mismo dentro de los bloques. Gracias de nuevo, Dave. –