简体   繁体   中英

Old Xcode project with iPhone and iPad storyboard to new Xcode 6 universal

I have an old project (started from Xcode 4) that has now two storyboard inside, one for iPhone and one for iPad. Now I want to delete the iPhone storyboard from the complete project and use the iPad storyboard and start with the Universal Auto Layout from Xcode 6. I am kinda lost how to get the iPhone Storyboard completely out. Who can tell me how to do this?

I tried with this method to force iPhone to use the iPad layout:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
  self.window.rootViewController = self.viewController;
  [self.window makeKeyAndVisible];
  return YES;
}

It loads the iPhone from the layout of the iPad as it is but is gives me some bugs, certain parts are not loading in the app such as buttons etc. that are on the main view. So it does not really do the trick.

Was actually simple (xCode6):

  1. open file inspector and delete Main_iPhone.storyboard
  2. in the file inspector rename Main_iPad.storyboard to Main.storyboard
  3. in the general settings tab click iPhone and tell to use the main storyboard as well
  4. find the info.plist in your file inspector and right click, now open as source code.
  5. change targetRuntime from "iOS.CocoaTouch.iPhone" to "iOS.CocoaTouch"
  6. click your storyboard in the file inspector and go to the info panel and check the box for Use Size Classes.

Done, the iPad has the default layout (still the same) and you can start building the iPhone as an adaptive layout from the iPad layout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM