Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A probable reason for this is that the animations are not synchronized with each other. Try by putting both the animation blocks together:</p> <pre><code>[UIView animateWithDuration:0.2 animations: ^{ CALayer *myLayer=self.image2.layer; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.x"]; animation.fromValue = [NSNumber numberWithFloat:(1 * M_PI/Down)]; animation.toValue = [NSNumber numberWithFloat:(1 * M_PI/UP)]; animation.repeatCount =0; animation.duration=0.2; [animation setRemovedOnCompletion:NO]; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; [self.image2.layer addAnimation:animation forKey:@"transform.rotation.x"]; CATransform3D transform = CATransform3DIdentity; transform.m34 = (1/500.0f); transform = CATransform3DRotate(transform, (1 * M_PI/UP), 1, 0,0); myLayer.transform=transform; // second animation code CABasicAnimation *animation2 = [CABasicAnimation animationWithKeyPath:@"transform.rotation.x"]; animation2.fromValue = [NSNumber numberWithFloat:(1 * M_PI/Down)]; animation2.toValue = [NSNumber numberWithFloat:(1 * M_PI/UP)]; animation2.repeatCount =0; animation2.duration=0.2; [animation2 setRemovedOnCompletion:NO]; animation2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; [card.layer addAnimation:animation2 forKey:@"transform.rotation.x"]; CATransform3D transform = CATransform3DIdentity; transform.m34 = (1/500.0f); transform = CATransform3DRotate(transform, (1 * M_PI/UP), 1, 0,0); card.layer.transform=transform; } completion:^(BOOL finished) { self.image2.postion=@"UP"; card.postion=@"UP"; }]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload