In my project I have allowed only portrait rotation, but for one ViewController
I would like to enable also landscape. I'm presenting this ViewController
as ModalViewController
, I've tried using methods - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation
or iOS 6 methods like -(NSUInteger) supportedInterfaceOrientations
but nothing actually worked. The view didn't rotate although those methods got called.
After this I've tried to rotate it by myslef with listening to those notifications :
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
but even though I was able to manually rotate the view
in method didRotate
: it's very messy and I can't rotate the StatusBar
.
I would really like to use standard methods like shouldAutorotateToInterfaceOrientation
, but I don't know how. Anyone?