
Is it possible to change the UIViewController orientation dynamically?

To enable the interface orientation in UIView just add the given code into your interface orientation method..
UIInterfaceOrientation interfaceOrientation = self.interfaceOrientation;
typedef enum {
UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeLeft,
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeRight
} UIInterfa

iPhone Interface Orientation code
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return YES; // Return YES is the same as entering all interfaces.
}
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {
[self presentModalViewController:landscapeChartViewController animated:NO];
}
if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
[self.parentViewController dismissModalViewControllerAnimated:NO];
// self.parentViewController seems like a call FROM the modalViewController.
// This should be moved to the modalViewControllers implementation
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.