Auto-resize iPhone xib app to ipad

ios, ipad, iphone, xib

Solution

You'll need to create only new xib files for iPad and name them as `ViewController_iPhone.xib` and `ViewController_iPad.xib` and when switching your views, just put a simple condition

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
    ViewController *viewController = [[ViewController alloc] initWithNibName:
                 @"ViewController_iPad" bundle:nil];
} else {
    ViewController *viewController = [[ViewController alloc] initWithNibName:
                 @"ViewController_iPhone" bundle:nil];
}

Problem

I built an iPhone app "using xib" with 5-6 screens. Now I want to auto-resize the display for iPad. I am using xcode 4.6. Do I have to rebuild the entire code using storyboards? It will be a very tedious work. Is there any solution for this?

Original source