Xcode: Need to lock game to portrait only

2019-01-26 14:40发布

问题:

I just released a game to the app store and realized I completely forgot to lock it to portrait only. I need to submit an updated version that does just that. At this point, is it enough to just go to general > deployment info and uncheck everything but Portrait and then submit this as a new build? Or do I also need to do something to the code? Please note that it's a swift app.

回答1:

Simple.

Here's how you do it.

This works for both objective c and swift.

1. Open your project and go do your build settings.

Scroll down to the tab that says Deployment Info.

3. From there you can see a section called Device Orientation, This is where you need to be. Select an orientation like so.

4 Build the project and you are done!



回答2:

There are two different plist keys for iOS in info.plist for orientation,

  • Supported Device Orientations
  • Supported Device Orientations (iPad)

Both of these must have the appropriate key value pairs in the plist.



回答3:

Go to your info.plist file, Supported interface orientations, delete the keys you don't need.



回答4:

The basic answer is: yes, that should be sufficient.

However:

  • Some elements of your application might not adapt well. I know I had problems with the UIImagePickerController for a landscape-only app. So watch out for functionality that you yourself haven't written and how that interacts with the restriction.
  • If you have code related to orientation (pushing a certain mode etc) it's probably worth testing.
  • You should make the change and test it before submitting. I think there may be ways of holding the release with Apple until you've had the portrait only one approved.