Joe Beuckman 2011

iOS

One ViewController for Both iOS Devices and Orientations

Building a view to support iPad and iPhone is a little clunky. Apple suggests that separate UIViewController’s be built, one for each device. But the vast majority of ViewControllers will want to implement the same logic whether being run on iPad or iPhone. For instance, say my view shows an image and presents a text box and a button. The ViewController needs to respond to the button by doing something with the text in the text box. This functionality is exactly the same no matter the device.