/ Published in: Objective C
Expand |
Embed | Plain Text
CAKeyframeAnimation *bounceAnimation=[CAKeyframeAnimation animationWithKeyPath:@"position"]; bounceAnimation.duration=timeForAnimation; CGMutablePathRef thePath=CGPathCreateMutable(); CGPathMoveToPoint(thePath, NULL, 160, 514); CGPathAddLineToPoint(thePath, NULL, 160, 350); CGPathAddLineToPoint(thePath, NULL, 160, 406); bounceAnimation.path=thePath; CGPathRelease(thePath); CABasicAnimation *mainAnimation=[CABasicAnimation animationWithKeyPath:@"transform"]; mainAnimation.removedOnCompletion=YES; mainAnimation.duration=timeForAnimation; CAAnimationGroup *theGroup=[CAAnimationGroup animation]; theGroup.delegate=self; theGroup.duration=timeForAnimation; theGroup.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; [imgV.layer addAnimation:theGroup forKey:@"sagar"]; imgV.center=CGPointMake(160, 406); imgV.transform=CGAffineTransformIdentity;
You need to login to post a comment.
