I have storyboard project in xcode. Most scene is show in portrait orientation but I want to show one of scene in landscape mode without user rotate the device, always this scene is shown it must be in landscape. This scene has a simple viewcontroller with uiwebview object wich I open a pdf file from url. My idea is show the viewcontroller as a modal viewcontroller.
Anyone known how solve this issue?, yesterday I spend my time searching about this in Internet but I don't find out a solution.
Thank you in advance!
Best Answer
How the scene is actually displayed is not determined by the storyboard but rather the viewcontroller. You need to create an
UIViewController
subclass and implement- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
to returnYES
only if the interface orientation is a landscape orientation. You could do it like this:to allow both orientations or replace with
to allow only one direction.