presentViewController or presentModalViewController not supporting orientation in iOS 6
Posted
by
Prateek
on Stack Overflow
See other posts from Stack Overflow
or by Prateek
Published on 2012-09-24T14:09:55Z
Indexed on
2012/10/03
15:37 UTC
Read the original article
Hit count: 319
I am new to this technology.
I am using this code
if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
{
[self presentViewController:navigationControllerCustom animated:YES completion:nil];
}
else
{
[self presentModalViewController:navigationControllerCustom animated:YES];
}
My application has two orientation Portrait and Portrait upside down. This code works well with iOS 5.1, but orientation does not work on iOS 6
I have also added this code on my navigationControllerCustom class
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
-(NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
Please help me to solve this issue.
Thanks in advance.
© Stack Overflow or respective owner