If you are using a UINavigationController
as base view controller , that code snippet you provided simply doesn't work. Because you are adding that code to a UIViewController
but it's already embeded in a UINavigationController
.
To overcome this issue, you must create a subclass of UINavigationController
and add that landscape related code to that subclass. Then assign this subclass to your Storyboard's base Navigation Controller. Then this issue will be solved.
This is your navigation controller sub class' .h file
@interface YourCustomNavigationController : UINavigationController
@end
And add this to your navigation controller subclass' .m file
- (BOOL)shouldAutorotate
{
//returns true if want to allow orientation change
return YES ;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
And make sure to assign this class to your base Navigation controller using interface builder's identity inspector.
Project settings,

EDIT:
You can present a UIImagePickerController
in landscape mode. Regardless of what documentation says, you can actually subclass it and can override it's functionality to work on landscape mode. (atleast its working on iOS 7)
To do this, you must create a subclass of UIImagePickerController
and add above lines to that subclass. Project settings must be same as screenshot (atleast one landscape mode and one portrait mode must be ticked).
Then use that subclassed ImagePicker controller when you presenting the camera. It would successfully load camera in landscape mode. But standard camera controls will be misaligned and messed up. So better to hide defaultControlls (picker.showsCameraControls = NO;
) just like you've done and use an overlay view instead.