Tag Archives: orientation

Supporting orientation changes the easy way!

A couple of days ago I wrote a quick tutorial on how to support multiple orientations in an iPhone app without any stress. Then the more astute of you will have noticed it disappeared. Well, I decided to make my Layout Manager a little more friendly and easy to use. Down at the bottom of this post you’ll find a project with a couple of demo views and the manager itself. It’s very easy to follow. Here’s the back story…

Until recently I’ve only bothered supporting portrait orientation in my iPhone apps. I suspect this was largely driven by a lack of need to support anything else, and partially an inherent laziness which always seems to prevail over my work. Anyway, turns out that sometimes I DO need to support different orientations so I went to work looking for a clean way to do it and arrived at the following solutions….

  1. Create two view controllers and swap them out with a navigation controller.
  2. Programmatically move stuff when the orientation changes.
  3. Run around panicking about the fact you can’t support orientation changes.

In all my searching, I didn’t find an easy way to do it, so I went for option 2 and set about making a nice clean way to get it all to just ‘happen’ without too much effort. Eventually I arrived at the solution that this blog post is all about. Here’s what I did… Continue reading