UIView animations on a path not linear
Posted
by
chis54
on Stack Overflow
See other posts from Stack Overflow
or by chis54
Published on 2012-09-01T21:35:25Z
Indexed on
2012/09/01
21:37 UTC
Read the original article
Hit count: 186
I have an iOS application that I want to animate a falling leaf (or several). I have my leaf image in an ImageView
and I've figured out a simple animation from the documentation:
[UIView animateWithDuration:4.0f
delay:0
options:UIViewAnimationTransitionFlipFromLeft
animations:^(void)
{
leaf1ImageView.frame = CGRectMake(320, 480, leaf1ImageView.frame.size.width,leaf1ImageView.frame.size.height);
}
completion:NULL];
This will make the leaf go from its starting position to the bottom right corner in a straight line. How would I animate this to follow a path or curve like a parabola or sinusoid and maybe even rotate the image or view? Would this be done in the animations block? Thanks in advance!
© Stack Overflow or respective owner