Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 03-15-2010, 08:22 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 202
Default Consecutive Animations

Hello SDK Guru's

I asked this on the regular board but I didnt have much luck.

I currently have this code, it makes an image appears while rotating. It works fine.

Code:
	
        myImage.alpha = 0;;
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:2];
	[UIView setAnimationDelay:0];
	[UIView setAnimationRepeatAutoreverses:NO];
	myImage.alpha = 1;
	my.transform = CGAffineTransformMakeRotation(-(3.14/2));
	[UIView commitAnimations];
I want this to work right after above animation finishes. It reverses whats above, but with a different speed.

Code:
	
        myImage.alpha = 1;
	myImage.transform = CGAffineTransformMakeRotation(0);
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:.2];
	[UIView setAnimationDelay:0];
	[UIView setAnimationRepeatAutoreverses:NO];
	myImage.alpha = 0;
	my.transform = CGAffineTransformMakeRotation(0);
	[UIView commitAnimations];
When I combine the two, it just executes the second effect ignoring the first. How would I have both running with a small delay in-between?

I already put delay of 2 for second animation set as suggested on the other board, but nothing seemed to work yet.

Thank you in advance.
sle39lvr is offline   Reply With Quote
Old 03-16-2010, 04:50 AM   #2 (permalink)
Mobile and Web solutions
 
hello24's Avatar
 
Join Date: May 2009
Location: London, UK
Posts: 72
Send a message via Skype™ to hello24
Default

In layman terms: the second animation doesn't wait for the first one to finish.

You will need to create a method containing the second animation and fire it up after a delay equal with the duration of the first animation:
[self performSelector:@selector(secondAnimation) withObject:nil afterDelay:2.0];
hello24 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 274
22 members and 252 guests
ADY, AragornSG, Bertrand21, Dani77, Dattee, fkmtc, HDshot, iDifferent, jakerocheleau, JasonR, jimbo, macquitzon216, mer10, prchn4christ, Rudy, sacha1996, silverwiz, sneaky, spiderguy84, Sunny46, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:07 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0