I have app for iPhone and it's done. This works only for potrait mode.
Client need an update saying whenever user browse photo/ watch video, he need landscape mode too so that when he rotate image or video, it will get full screen.
For this I ticked all four Device Orientation.
Then based on this answer, I made custom navigation controller file and assigned it.
.h file
#import <UIKit/UIKit.h>
@interface CustomNavigationController : UINavigationController
@end
.m file
#import "CustomNavigationController.h"
@interface CustomNavigationController ()
@end
@implementation CustomNavigationController
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
@end
Now when I run app and rotate to landscape, still I see potrait mode only.
Till now this is fine.
Now what I want to do is, for some screens, I want landscape mode too. Any idea how can I do the same?
Edit 2
When I hide what I have in CustomNavigationController, and try to rotate iPhone, the image is also rotating. This is happening because I have hidden the code which says "I am not allowing for rotation" return NO
.
So is there any way where I can say for the images, also allow iphone to go to landscape mode?
For photo browsing, I am using https://github.com/mwaterfall/MWPhotoBrowser