Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Targeted for iPad option in Xcode

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?

like image 620
Chiron Avatar asked Jan 22 '11 00:01

Chiron


People also ask

How do I change target iOS in Xcode?

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.

How do I select target in Xcode?

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.

What is target in iOS Xcode?

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.

How do I add an iPad icon to Xcode?

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.


1 Answers

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.

like image 61
grahamparks Avatar answered Oct 08 '22 03:10

grahamparks