How to support iPad 1 rotation in Xcode 5

I was very excited when an old iPad 1 was delivered to me today – in marvellous condition! It will allow me to test my apps against iOS 5.1.1.

I immediately noticed that all Xcode 5 templates no longer have the rotation code embedded – without which iPad 1 won’t auto rotate.

Here’s what you need to implement into your UIViewController sub classes to support auto rotation:

Note than when you’re using the Master/Detail Template or any Split View Controller app you need to implement the above method in BOTH view controllers. Don’t ask me why – I’m just the messenger.

If you have an app based on a tab bar controller which houses several other view controllers, it’s enough to add this statement once to the initial view controller to make rotation work on all other view controllers. So the view controller currently “in vision” needs to have the above statement added.

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.