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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-11-2008, 09:51 AM   #2 (permalink)
Jume
Registered Member
 
Jume's Avatar
 
Join Date: Jul 2008
Location: Slovenia, EU
Posts: 264
Jume is on a distinguished road
Send a message via Skype™ to Jume
Default

Ok finally figured it out how to do that. It fairly simple. It is done by a use of UIDevice class which provides notifications for device orientation. Here is how I implemented view transitions when device changes orientation without UIView's self autorotate methods. Hope someone finds this useful.

Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
	[window addSubview:tabBarController.view];
	
	[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];	
	[[NSNotificationCenter defaultCenter] addObserver:self
										  selector:@selector(didRotate:)
										  name:@"UIDeviceOrientationDidChangeNotification" 
										  object:nil];	
    
	if ([self isDataSourceAvailable] == NO) {
        return;
    }
}

- (void) didRotate:(NSNotification *)notification
{	
	UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
	
	if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight)
	{
           //view transition code in here
	}
}
BR,
Jume
Jume is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,282
Threads: 93,959
Posts: 402,319
Top Poster: BrianSlick (7,971)
Welcome to our newest member, kurtwatson
Powered by vBadvanced CMPS v3.1.0

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