Vangogh500
Vangogh500

Reputation: 959

Landscape only on XCode 6

Hi so I've been playing around with XCode and can't seem to figure out how to make an application landscape only. Wondering if there is a simple/storyboard solution.

I've tried checking the landscape left and landscape right and unchecking the portrait on the general page under "device orientation".

However this strangely just displays the w Compact h Regular set up on my storyboard horizontally (as opposed to showing the W Any h Compact set up). I mean technically I can work around this, but it seems annoying/inefficient to rotate my head 90 degrees while working on the portrait settings.

If there is only solution in code, I would appreciate it in swift!

EDIT: Hmmm, after some testing it seems as if the phone I'm testing on only shows the rotated version of the portrait settings. It's an iPhone 4 and maybe outdated for handling 2 seperate set ups for portrait and landscape.

Thanks!

Upvotes: 0

Views: 122

Answers (2)

dunnmifflsys
dunnmifflsys

Reputation: 621

Just for anyone with this problem in the future, here's the problem: The storyboard editor by default will display the editor as any by any, as it should. Size classes should ONLY be used when you need to change something specifically for one kind of size class (in other words, things that will be different on different devices. You should still edit everything in the any x any orientation, and regardless of if it's landscape only because size classes will still change from device to device for landscape orientation.

Upvotes: 1

matt
matt

Reputation: 535222

It's an iPhone 4 and maybe outdated for handling 2 seperate set ups for portrait and landscape

That could be it. Size Classes were invented in iOS 8. So on a system earlier than iOS 8, they are not supported, and your results will be, shall we say, unpredictable.

Upvotes: 0

Related Questions