I had an app that the launch orientation was critical for me to know. I was frustrated to learn that Apple's official position was that you should create your view in portrait. From the docs for UIViewController
:
At launch time, apps should always set up their interface in a
portrait orientation. After the
application:didFinishLaunchingWithOptions: method returns, the app
uses the view controller rotation mechanism described above to rotate
the views to the appropriate orientation prior to showing the window.
You can follow Harsh's suggestion but it won't work…not quite how you need it to anyway. The reason why is that the correct orientation notification isn't generated for a second or so after the app has launched. I think Aaron's suggestion of using viewWillLayoutSubviews
might be worth looking into.
On my app I referred to above, I didn't load the view until I got the first legitimate notification of what orientation the device was in. Instead I just showed the launch image for a split second longer until I knew which orientation to set the view up with.