How to implement the welcome page animation of appflow - iphone

Below image is from AppFlow welcome page animation.
Not launch image, this is just part of welcome page , part of.... not all welcome page and I can't show the animation here, so I screen shot some frames of this animation and rearrange here.
I am sure that is not a gif or any image animation, should finished by objc code. Anyone could give me some thread or sample code will be great!
Thanks

There are plenty of ways of displaying animations in iOS. For the animation you described above, I would recommend making one PNG image per frame. Then you can display the animation in a UIImageView similar to below:
imageView.animationImages = [NSArray arrayWithObjects:[UIImage imageNamed:#"1.png"], [UIImage imageNamed:#"2.png"], nil];
imageView.animationDuration = 1;
imageView.animationRepeatCount = 0;
[imageView startAnimating];
Place the UIImageView on the welcome view controller.

Related

Animating imageview takes time for first time

I am animating the ImageViews then the user taps a button. I have more than 40
images. The code I have used is
arr3 = [[NSArray alloc]initWithObjects:[UIImage imageNamed:#"Aperture_00000.png"],
[UIImage imageNamed:#"Aperture_00001.png"],
[UIImage imageNamed:#"Aperture_00002.png"],
...
[UIImage imageNamed:#"Aperture_00023.png"], nil];
imgv.animationImages = arr3;
imgv.animationDuration=2.0f;
imgv.animationRepeatCount =1;
The method to start the animation is:
-(void)animate {
[imgv startAnimating];
}
But it takes a lot of time when the user presses the button for the first time. What could be the solution for this?
The reason is following code:
arr3 = [[NSArray alloc]initWithObjects:[UIImage imageNamed:#"Aperture_00000"],[UIImage imageNamed:#"Aperture_00001"],[UIImage imageNamed:#"1.png",#"2.png",#"3png",#"4.png",#"5.png",#"6.png",#"7.png",#"8.png",#"9.png",#"10.png",#"11.png",#"12.png",#"13.png",#"14.png",#"15.png",];
What you can do is load this array somewhere else.
Note : This is a very memory consuming way of loading the images. Your app will definitely crash after you visit this class 2-3 times. Instead of this use some alternative. The easiest alternative I can suggest is load a image on UIImageView and change the image periodically. It'll give you animation effect.
I would suggest you rather doing it programmatically you should create animated gif image from the images. Here is online tool you can set speed and other parameters
http://picasion.com/
and use
https://github.com/arturogutierrez/Animated-GIF-iPhone
UIImageView category to display that gif image in that case you can save your CPU time.
Unhide the imageView when you want to play animation and hide when you want to stop.
I would suggest to give that at least a try.

Animate Logo just like Skype iPad App

I am building a application I need to animate logo just like skype application. I am still not sure how to get the affect skype logo appear while starting the application
As far as my understanding on your question, you can try using frame images (frames of gif images to be precise )on UIImageView.
NSArray * imageArray = [[NSArray alloc] initWithObjects:[UIImage imageNamed:#"1.png"], [UIImage imageNamed:#"2.png"], nil]; //this will be the frames of animation images in sequence.
ringImage = [[UIImageView alloc]initWithFrame:CGRectMake(100,200,600,600)];
ringImage.animationImages = imageArray;
ringImage.animationDuration = 1.5;//this the animating speed which you can modify
ringImage.contentMode = UIViewContentModeScaleAspectFill;
[ringImage startAnimating];//this method actually does the work of animating your frames.
To STOP the animation, just use [ringImage stopAnimating];
Do let me know if this answers your question:)
Hey I just find out this example using MCSpriteLayer...
You can go through this link...
Also they have downloadable link Here
This solved my purpose hope this will help you guys too

Which animated file types are supported by iOS?

I just want to add an animated file to my application.
Most of the postings I have read, are using UIImageViews or collection of the multiple images. I don't want to do that.
I just want to know which animated file formats are working on iOS (I know .gif and .swf are not working on iOS).
So is there any other file format, which I can use in my app OR let me know if there is any other framework to use the animated file.
You may use gif. You need to show inside UIWebView.
we cant use any animated file like .gif, .swf because apple not allows us. if you want to animate the images just do that way.
UIImageView* campFireView = [[UIImageView alloc] initWithFrame:self.view.frame];
// load all the frames of our animation
campFireView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:#"campFire01.png"],
[UIImage imageNamed:#"campFire02.png"],
[UIImage imageNamed:#"campFire03.png"],
[UIImage imageNamed:#"campFire04.png"],
[UIImage imageNamed:#"campFire05.png"],
[UIImage imageNamed:#"campFire06.png"],
[UIImage imageNamed:#"campFire07.png"],
[UIImage imageNamed:#"campFire08.png"],
[UIImage imageNamed:#"campFire09.png"],
[UIImage imageNamed:#"campFire10.png"],
[UIImage imageNamed:#"campFire11.png"],
[UIImage imageNamed:#"campFire12.png"],
[UIImage imageNamed:#"campFire13.png"],
[UIImage imageNamed:#"campFire14.png"],
[UIImage imageNamed:#"campFire15.png"],
[UIImage imageNamed:#"campFire16.png"],
[UIImage imageNamed:#"campFire17.png"], nil];
// all frames will execute in 1.75 seconds
campFireView.animationDuration = 1.75;
// repeat the annimation forever
campFireView.animationRepeatCount = 0;
// start animating
[campFireView startAnimating];
// add the animation view to the main window
[self.view addSubview:campFireView];
or see that link www.appsamuck.com/day2.html
By default a GIF won't animate correctly in a UIImageView. However, with a little extra effort you can get them to work.
This project looks the most promising as it appears to actually decode the gif and display the individuals frames for you.
https://github.com/arturogutierrez/Animated-GIF-iPhone/
Otherwise, the other solutions I've seen are what you mentioned. (Separating the gif into multiple images manually)
http://www.alterplay.com/ios-dev-tips/2010/12/making-gif-animating-on-ios.html
You can use cocos2D for this animation. Use with CCSpriteSheet.

Photos App Animation Advice

I have scoured the net for this question and have came up empty handed. I have an app that I'm making which I want the user to be able to view an image i have hooked up to the UIImageView to show fullscreen. Basically by tapping the UIImageView it would make the buttons and status bar disappear until image is tapped again. I know this is probably a simple animations block that i would throw in my viewdidload or where I call my image from. I'm just unsure where it goes.
here is where my image comes from if the helps.this is in my .m file
-(void)viewDidLoad {////Loads UIImageView from URL
todaysWallpaper.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:#"http://www.inkdryercreative.com/daily/archive/mondays/images/062-mondays-960x640-A.jpg"]]];
I have four buttons that appear on screen. i want it to resemble the feel you get in the native photos app when you look and a picture and everything else on screen dissolves. Any help or guidance would be great. I can send additional code if needed
CGRect *oldFrame = todaysWallpaper.frame; // store this somewhere for when you go back
CGRect *newFrame = [[UIScreen mainScreen] bounds];
[UIView animateWithDuration:0.5 animations:^{
todaysWallPaper.frame = newFrame;
}];

How to know/test when an animation has finished playing

I am starting an animation via a button press. Here is the code for the button:
-(IBAction)startAnimation:(id)sender{
stick.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:#"photo 1.JPG"],
[UIImage imageNamed:#"photo 2.JPG"],
[UIImage imageNamed:#"photo 3.JPG"],
[UIImage imageNamed:#"photo 4.JPG"],
[UIImage imageNamed:#"photo 5.JPG"],nil];
[stick setAnimationRepeatCount:200];
stick.animationDuration = 0.5;
[stick startAnimating];
}
and when the animation is done, i want to have a button appear, to play another animation on the screen. How can i test or see when my animation is done playing? Thanks in advance!
You haven't told us what stick is, but it looks like a UIImageView. You can only call isAnimating to check whether the animation is still running but you don't get any notification and there's no delegate either. You can calculate the stop time (200 * 0.5) and thus set up a timer (add a little safety margin). This won't be 100% correct but it might be "good enough".
If you called your animation using blocks, you could use a completion block.
Here is a tutorial you can refer to which shows a couple different ways to call animation routines on iOS. This tutorial also shows what you can do for completion if you don't feel like using blocks (namely UIView's setAnimationDidStopSelector method).