0

I have an iPhone application available in appstore. Now i would like to develop Universal version of the same app. The iPad version of the current application will be the same. Just screens will be adapted for iPad size. The behaviour won't be changed due to device type.

My question is below: In iPhone version, there is a page which displays hotel list. The controller class is:

HotelListViewController.m
HotelListViewController.h

the xib is: HotelListViewController.xib

Now which is best practice for making same page of iPad: Option 1: Just creating HotelListViewControlleriPad.xib and using same HotelListViewController.m and .h

Option 2: Creating HotelListViewControlleriPad.xib creating HotelListViewControlleriPad.m and h

thanks.

Ahmet
  • 85
  • 1
  • 8

2 Answers2

3

You need to go by option 1, as only view differs so you need to have different xib for iPhone and iPad.

If in your controller, there is certain view related stuff then you can handle that stuff conditionally.

You can check this thread also for some interested related discussion - How to develop an universal app for iPhone + iPad without xib files?

Community
  • 1
  • 1
rishi
  • 11,779
  • 4
  • 40
  • 59
  • Yes Correct answer option:1 is best and use UIUserInterfaceIdiomPhone, // iPhone and iPod touch UIUserInterfaceIdiomPad, – Pandey_Laxman Jun 28 '12 at 11:57
1

Either go for option 1 or use the same xib and view controller class as in iPhone but make the view controller a child view controller of the full screen view controller on iPad (for example using split view controller or a custom container view controller).

Felix
  • 35,354
  • 13
  • 96
  • 143