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 12-11-2009, 06:10 AM   #7 (permalink)
erastusnjuki
Registered Member
 
Join Date: Nov 2009
Posts: 1
Thumbs up Getting this to work

Just for those who are stranded like I was ...here's some code that worked for me. with this the new view slid in
//1. Add the QuatzCore Framework from library to the Frameworks folder
//2. At the top include the header file

#import <QuartzCore/QuartzCore.h>

//3. Implement the code

yourViewController = [[YourViewController alloc]
initWithNibName:@"YourViewController"
bundle:nil];
// get the view that's currently showing
UIView *currentView = self.view;
// get the the underlying UIWindow, or the view containing the current view
UIView *theWindow = [currentView superview];

UIView *newView = yourViewController.view;

// remove the current view and replace with myView1
[currentView removeFromSuperview];
[theWindow addSubview:newView];

// set up an animation for the transition between the views
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseO ut]];

[[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];

Last edited by erastusnjuki; 12-11-2009 at 06:12 AM.
erastusnjuki is offline   Reply With Quote
 

» Advertisements
» Online Users: 250
19 members and 231 guests
ADY, apatsufas, ckgni, F_Bryant, IphoneSdk, jakerocheleau, joeallenpro, ketaskin, MarkC, michelle, NSeven, rob.mccarthy, rodrigozanatta, smethorst, Sunny46, themathminister, TheWebWizz, V_SC&, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,711
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

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