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?
To change your deployment target, open up your project file in Xcode and check the setting under Build Settings -> Deployment(...) Check this answer to add earlier devices support.
Go to project's settings in the Project Navigator panel. Under the Targets sections, right click the existing target and select Duplicate to copy your existing target. 2. Xcode will ask you if your new target is for iPad development.
A Target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.
It contains all mobile platforms ( iOS, Android, iWatch, etc) needed icons. Now you need to copy these icons into the Xcode project, what you need to do is just drag the folder AppIcon. appiconset under the iOS folder, and drop it to Assets.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With