0
votes

I have an iPhone app that has several different view controllers. A login screen and then three other view controllers that contain table views. I am using the storyboard, not NIB files, and have designed each view in a portrait orientation on the storyboard. When I run my app, the login screen switches between landscape/portrait when I turn the device and looks just fine. However, the other screens do not change...well, actually they WILL change from landscape to portrait, but they won't change from portrait to landscape. If I am on the login view, then navigate to the other views I can see them in landscape, but as soon as I turn the device and it switches to portrait, it's stuck until I go back to the login screen.

I've searched and found answers that involve NIB files, but nothing about how to work with the device orientation when using the storyboard. Am I missing some property to set on the view? How can I get my table views to work like my login view and automatically switch the orientation automatically?

1
Do all of your viewcontrollers return a YES from their shouldAutorotateToInterfaceOrientation methods?ott--
No, they do not...but where do I change the values that that method returns?kschuler
See my comment to the answer below.ott--

1 Answers

0
votes

If you want to lock the view orientation in code you lock it with this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}