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:39 PM   #7 (permalink)
jamesbrannan
Registered Member
 
jamesbrannan's Avatar
 
Join Date: Aug 2008
Location: Gaithersburg, MD
Posts: 178
Default

You are making things harder then they have to be. Check out the iphone 3.0SDK's Utility project's code. Also, the video above illustrates the easier way to do it. I will have the project's code available online soon. The narrative, though, is part of my upcoming book. Again, the technique my original video shows, and your tutorial shows, works, but isn't required

James A. Brannan

Quote:
Originally Posted by chaseacton View Post
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
jamesbrannan is offline   Reply With Quote
 

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

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