How can I load separate nib files for my iPhone app that checks whether the user has an iPhone 5/iPod Touch 4-inch screen versus a 3.5 inch screen?
Is this done in the init method?
Details
– I am not using a storyboard for the entire app. At one point I do use a storyboard and call it up from one of the view controllers. (is there a way to differentiate for storyboards as well?)
-
I am looking for a solution that initializes in each separate viewController… not something that I would put in the appdelegate that only runs once.
-
Autolayout doesn’t work in many situations situation for me. The designs are very graphical, and too much white space makes things look bad.
I have found a way!
Macro
I got this macro from https://stackoverflow.com/a/13068238/1492368 from RayOfHope
so In the new designated initializer initForLayout: I write
Old Initializer
I learned this from Big Nerd Ranch:
to throw an exception when using the standard initializer
Calling the View Controller from another ViewController/AppDelegate
So when I call this DetailViewController from another view Controller or the appdelegate I write: