I have a code:
NSArray * imageArray = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
[UIImage imageNamed:@"4.png"],
[UIImage imageNamed:@"5.png"],
[UIImage imageNamed:@"6.png"],
[UIImage imageNamed:@"7.png"],
[UIImage imageNamed:@"8.png"],
[UIImage imageNamed:@"9.png"],
[UIImage imageNamed:@"10.png"],
[UIImage imageNamed:@"11.png"],
[UIImage imageNamed:@"12.png"],
nil];
UIImageView * imgView = [[UIImageView alloc] initWithFrame:
CGRectMake(100, 125, 150, 130)];
imgView.animationImages = imageArray;
imgView.animationDuration = 2;
imgView.contentMode = UIViewContentModeBottomLeft;
[self.view addSubview:imgView];
[imgView startAnimating];
As you see, this code implements animation (change) of collection of images in imageArray.
During animation, each image changes with constant time interval, lets say it animates with easeNone transition.
But, How can I make this animation with easeIn, easeInOut transition?
Wow, It's been a year since this has been posted.
I'm unsure if you have found your answer, but what I have done is made the easing myself through the Images (1.png, 2.png.. etc.)
For example:
PNG's 1-5.png may have 10px spacing between the animated item.
PNG's 6-8.png may have 5px spacing between the animated item.
PNG's 9-10.png may have 2px spacing between the animated item.
finally
PNG's 9-10.png may have 1px spacing between the animated item, or no spacing difference at all.
Doing this will give you the Ease Out effect you're looking for.
What I like to do is set-up my animation in Xcode (like what you have done in your Question), then move over to Photoshop and overwrite the PNG's in my development folder, try them in the Simulator, and repeat until I get the desired effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With