How to make universal iOS application

6.8k Views Asked by At

My xcode version is 3.2.5.

My application was created on iPhone. I want that which I had written for iPhone should be run and work for iPad. How to work on this?

Help me friend, how to create this type of application?

5

There are 5 best solutions below

2
On

We recently used this template and we simply loved it! Lets u avoid IDIOM checks and the inheritance allows code reuse.

7
On

First step: Upgrade your Xcode. Second: open your application and change the target's "Devices" to "Universal". Xcode may prompt you to create XIBs for iPad by autoresizing - do this if you can, otherwise create the XIBs for iPad. I generally find it best to have a base class, and then two subclasses that contain functionality overrides - e.g.

@interface ViewController : UIViewController
@end

@interface ViewController_iPad : ViewController
@end

@interface ViewController_iPhone : ViewController
@end
4
On

To make your apps universal for devices like iPhone and iPad, you need to make duplicates of the code most of the time. If you are using XIB, make for both iPhone and iPad. Use IDIOM checks whenever required to avoid creation of duplicate classes (i.e. the classes containing duplicate logic).

For detail, you can refer this link How to make Universal Apps

2
On
0
On

To build universal app for both iPhone and iPad, I highly suggest to give up IB/XIB/Storyboard, prefer to create any UI components with code directly. We can use the macro to check which device and just use the same macro for full screen etc. I know some people would prefer IB because it is easy to see what they built, but that will bring a bit efforts for different XIB version.