CAAnimation rotation did not give last stage?

Posted by Mikhail Naimy on Stack Overflow See other posts from Stack Overflow or by Mikhail Naimy
Published on 2010-12-30T13:46:37Z Indexed on 2010/12/30 13:54 UTC
Read the original article Hit count: 291

hi, i am using following code to rotate the UIView through Swipe gesture .it works fine.but after rotation, it goes to beginning angle or Fromvalue.anyone can help to stop the view in last stage.if i rotate again, it must go from last stage.

      rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    rotationAnimation.fromValue = [NSNumber numberWithFloat:0.0 * M_PI];

        rotationAnimation.toValue = [NSNumber numberWithFloat:0.5 * M_PI];

    //rotationAnimation.toValue = [NSNumber numberWithFloat: 2.5 * 3.15 ];
    rotationAnimation.duration = 1.5;
//rotationAnimation.cumulative = YES;
    rotationAnimation.removedOnCompletion = NO;
rotationAnimation.repeatCount = 0.0; 
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
    [self.view.layer addAnimation:rotationAnimation forKey:@"rotationAnimate"]; 

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ipad