I created an app with Swift and tested it out on my iPod touch. The problem is, sometimes I accidentally rotate the screen a little while playing, which throws off everything entirely. Is there a way in Swift to make it so even if the player rotates the device sideways it never turns to landscape mode?
Asked
Active
Viewed 287 times
3 Answers
1
You will want to
- Click on the top-left corner (Show the Project Navigator)
- Select the name of your project
- See what is under General->Deployment Info->Device Orientation.
- Adjust the tickboxes accordingly.

esaruoho
- 896
- 1
- 7
- 25
0
If you click on your project in top left corner and on the Info tab you can un-tick some of the orientation tick boxes to only allow Portrait.

Joe Benton
- 3,703
- 1
- 21
- 17
0
It's simple.It's not on Swift though.Just swipe up on your ipod and a little tab should come up. Once there,a button with an unlocked lock with an arrow around it.Click it and it should become locked.Now,it won't turn into landscape mode when you turn it! :)

Lavi
- 1
-
They wanted to know how to restrict the orientation of the app, not the phone – Joe Benton Dec 27 '15 at 23:06
-
Welcome to SO. This is a technical site for developers. Most questions here are related to software development, not on how to use an iPhone, which would be considered off-topic. – Software Engineer Dec 27 '15 at 23:18