I've Created an iPhone App.I Want To Make it Universal on Next Version But When I Choose Universal From Deployment Info Menu it Does not Creat Main-iPad Storybiard.Anyway I Created it Myself and When I Tried too Test it on iPAd it shows iPhone storboard!
You have to create an ipad storyboard, click on the ipad button under the universal setting, and then set the ipad storyboard there: Here is what you're needing to do.
Edit:
Since you are still experiencing the iphone look on the ipad, go to your .plist file, and check for:
hope it helps
The storyboards are created and configured automatically when you create the project in universal mode. If you started for iPhone only, and switch to universal later, you'll need to set the different storyboards in the project settings.
To do so, go to project settings and choose your target. Note that in 'Deployment info' under your choice for 'Universal' there are two buttons 'iPhone' and 'iPad'. You can select 'iPad' there and select your iPad storyboard.
You need to create iPad Storyboard, not iPhone.
And You need to select that storyboard at general tab(At targets).
Maybe change in the app delegate this:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"MainStoryboard" bundle:nil];
To something like this.
UIStoryboard *storyboard;
if ([[UIDevice currentDevice] userInterfaceIdiom] ==UIUserInterfaceIdiomPad) {
storyboard = [UIStoryboard storyboardWithName:#"MainStoryboard_iPad" bundle:nil];
} else {
storyboard = [UIStoryboard storyboardWithName:#"MainStoryboard_iPhone" bundle:nil];
}
Related
Long time lurker, always tried very hard to search and have found many answers this way. This is the first time I have found nothing that fixes my problem. This is also my first solo app, as I am a new developer.
I have two devices- an iOS 8.1 iPhone 6, and an iOS 7 iPad Mini Retina 2.
I am building my first iOS app. It uses storyboards for a UITabBarController with three tabs, each of which contains a UINavigationController and a custom sub view controller (such as a subclass of tabbarcontroller or collectionviewcontroller).
Under Deployment Info:
Deployment Target is set to 7.0 and Universal. iPhone and iPad both use the MainStoryboard main interface, with all four Device Orientations checked for both.
My AppDelegate starts with:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"MainStoryboard" bundle:[NSBundle mainBundle]];
UITabBarController *initViewController = (UITabBarController *)[storyboard instantiateViewControllerWithIdentifier:#"rootTabBarController"];
NSLog(#"%d %d",initViewController.shouldAutorotate,initViewController.shouldAutomaticallyForwardRotationMethods);
[self.window setRootViewController:initViewController];
Note the NSLog; it prints "1 0".
So from what I can see- the tab bar should auto rotate.
On my iPhone, when I turn the device sideways, the status bar on the top rotates- but the content remains upright. If I hit the Home button and switch back to the app while holding it sideways, everything goes wonky- the content rotates but doesn't rearrange the layout, so it remains vertical, and thus gets cut off and there's a big black section on the side.
On my iPad, though- everything works fine! The application rotates as expected and resizes itself.
What am I doing wrong here? Thank you tremendously for any help.
Why are you programmatically loading the storyboard? If there's no specific need to do that, I'd suggest just using the template app delegate code. Better yet, create a completely new, fresh project and just copy over your storyboard. It won't necessarily make sense, but... I bet it will work!
I have an iPhone project which completed successfully and pushed into AppStore. Now i want to change that project in to Universal project. But the problem is that iPhone layout and iPad layout is completely different. In iPhone i have common design, but in iPad it comes as a SplitViewController. Actually the problem is in xcode 6, We are dealing with auto layout and size classes. We have only one storyBoard to deal with iPhone interface and iPad interface. I have no idea about how to implement this. Implementing SplitView and configuring it for iPad when iPhone has an other design.!
If anyone already worked on these kind of projects, please tell me your suggestions. Thanks in advance.
I have dealt with the same kind of project , where I have different designs for iPhone & iPad . Though by default there is a single storyboard to be commonly used for iPhone & iPad but I added an additional storyboard and design them separately for iPhone & iPad , and in AppDelegate's applicationDidFinishLaunching method I conditionally load the storyboard based upon the device (either iphone or ipad) .
if ([UIDevice currentDevice].userInterfaceIdiom==UIUserInterfaceIdiomPad) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"Main~iPad" bundle:nil];
UIViewController *initViewController = [storyboard instantiateInitialViewController];
[self.window setRootViewController:initViewController];
}
else{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"Main" bundle:nil];
UIViewController *initViewController = [storyboard instantiateInitialViewController];
[self.window setRootViewController:initViewController];
}
App is live in AppStore at the moment with no issues. Hope this approach will help you
I created my project back before iOS8 and Xcode 6 came out. I'm supporting down to iOS 6.0, and have two Storyboards, one for iPhone and one for iPad.
Now, in Xcode 6, I'd like to add support for the new screen sizes (iPhone 6/6plus). When creating a new Storyboard, it is using the new format (square), which is good, but I'm not sure how to proceed. Can I decide which devices uses which storyboards? Or is the new Storyboard-setup supported on older iOS-versions?
Can I throw away my old Main_iPhone.storyboard and create a new Xcode6-storyboard (with support for iPhone 6-sizes) while still supporting iOS 6/7? Or do I have to keep the old storyboards to work with versions below iOS8?
If I need to keep them, where do I set the logic for which devices use which storyboards?
we can use more then one story board in one project.and call particular story board and identify the particular viewcontroller according to the identifier.
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:#"Main" bundle:[NSBundle mainBundle]];
PlaceDetailViewController *place=[mainStoryboard instantiateViewControllerWithIdentifier:#"placedetail"];
[self.navigationController pushViewController:place animated:YES];
}
My OS version is OS X Version 10.9.4.
XCode Version is 6.0.1
Everytime I create a new project ,the storyboard is always for ipad even I choose Device to iphone.The old projects with iphone storyboard work fine.But Everytime I create a new project whatever I choose ,it is always ipad storyboad.Please help me!
You can change it programmatically
NSString *storyName = #"MainStoryboard_iPhone";
if ([[UIDevice currentDevice] userInterfaceIdiom] ==UIUserInterfaceIdiomPad) {
storyName = #"MainStoryboard_iPad";
}
UIStoryboard *story = [UIStoryboard storyboardWithName:storyName bundle:[NSBundle mainBundle]];
or made by default the storyboard on your settings projects. On General, deployment target, main interface, switch between iPhone / iPad
On xCode 7: select the View Controller, click on Attributes Inspector at the top of the Utilities sidebar (left side.) At the top is a size drop down. Use it to select the size you want to view.
Appears this has to be done for each ViewController.
I've an application for iPhone. At first we were not planning to release it for iPad. But now we want it available for iPad. I've searched enough for that but didn't find any good way to add .xib for iPad.
I know there are other way to change it to support iPad. In Xcode my projects Targeted Device Family is iPhone/iPad. The app now runs on iPad, But I want to add different iPad .xib for each view. How can I add different .xib for iPad?
You have a couple of options here.
1.) Use auto-layout to try to use the .xib files to layout/space correctly on the iPad.
OR
2.) Create new .xib files for the iPad specifically and every time you instantiate a view controller load the correct xib file based on the device type
ViewController *vc;
if (iPhone)
{
vc = [[ViewController alloc] initWithNibName:#"iPhoneNIB" bundle:nil];
}
else
{
vc = [[ViewController alloc] initWithNibName:#"iPadNIB" bundle:nil];
}