Targeted for iPad option in Xcode

IosIphoneXcodeIpad

Ios Problem Overview


In Xcode when creating a subclass of UIViewController, an checkbox named "Targeted for iPad" exists among others.
What if I want to create an app that runs on iPhone and iPad (I think it is called universal application)? should I check it?
If I checked it, what is happening under the hood?

Ios Solutions


Solution 1 - Ios

I tried both with and without and diffed the generated files.

The only difference it makes is whether the pre-built shouldAutorotate: method returns YES to all orientations (normal for iPad apps) or just for portrait (normal for iPhone apps). It also changes the dimensions of the UIView in the generated XIB file (if you tick the option to create one) from iPhone to iPad screen size.

So just choose whichever one sounds like the best starting point for the class you're about to create. Both things are trivial to edit later.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChironView Question on Stackoverflow
Solution 1 - IosgrahamparksView Answer on Stackoverflow