iosxcodeorientationlandscape

How can I force landscape for all views in Xcode


I tried to set the device orientation to landscape only (left & right) in the General tab of the target and also in the Info tab for iPad and iPhone, but portrait mode is still supported/enabled. Is this a Xcode bug or does anyone know why portrait mode is still supported even though I disabled it in both places? Preferably I would like to achieve it without setting it in code. I am using Xcode 13.


Solution

  • After playing around for a while I saw, that the portrait mode is still set in the Build Settings tab even though I disabled it in the General and Info tab. Just click on your Target -> Build Settings -> search for 'Orientation' and remove the portrait one if there is any.