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

View Single Post
Old 07-22-2009, 12:23 PM   #6 (permalink)
chaseacton
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Here's my version of the utility app tutorial complete with sound, code, and the xcode project!

Here is the video:

Flip View Tutorial on Vimeo

Here is the code in case it was too hard to read in the video:

.h file:

Code:
@interface MainViewController : UIViewController {
	IBOutlet UIView *secondaryView;
}
- (IBAction)toggleView:(id)sender; //Action for toggle view
- (IBAction)returnView:(id)sender;


@end
.m file:

Code:
//Flips to back when toggle button is pressed
- (IBAction)toggleView:(id)sender {
	[UIView beginAnimations:nil context:nil];
	[UIView setAnimationDuration:1.0];
	[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
						   forView:[self view]
							 cache:YES];
	[[self view] addSubview:secondaryView];
	[UIView commitAnimations];
}

//Flips to front when "Done" is pressed
- (IBAction)returnView:(id)sender {
	[UIView beginAnimations:nil context:nil];
	[UIView setAnimationDuration:1.0];
	[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
						   forView:[self view]
							 cache:YES];
	[secondaryView removeFromSuperview];
	[UIView commitAnimations];
}
Here is the finished project:

TutFlip.zip
chaseacton is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,871
Threads: 89,225
Posts: 380,695
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Darmanikles
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:48 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.