Making two storyboards for iOS (iPhone and iPad) - iphone

Is it possible to make only one application and inside of it make two storyboards, one for iPhone and one for iPad? I don't like the idea of running the app on iPad and clicking the 2x button.
My idea was to create two storyboards and have a beginning class that would check if the device you are using is an iPhone or an iPad and then redirect to the according storyboard after. I think it is a good idea cause the code is the same.

create two different storyboards and name them so they are easily specified which is which. Then click on the file that allows you to change settings for your actual app. and change the build to universal, then specify which storyboard you want to use!
there is a storyboard setting for iphone and ipad
iPhone
iPad
Make sure the names of the storyboards are correctly set though

Even if you already made an app non universal, just change it to universal (target-->summary), then create a new ipad story board and make sure under target-->summary that the main iphone storyboard and main ipad storyboard are set to the right storyboards.

Did you try creating new Universarl XCode project? If you create Universal project, there will be two Storyboards(One for iPhone and another one for iPad) created by default. i think.

I had to do this in a project recently... so first you should navigate to your projects target then click the summary button in the top bar you will then see a bar that says "iOS Application Target" in there you will see a drop down menu with a title that says Devices select the universal option. Now add a storyboard for the iPad. Now go back to the projects target and scroll down to the "iPad Deployment Info" section and set your new storyboard as the main storyboard in the text field here you can also add the iPad icon and launch images. Now you are set up for creating a universal app!

its very simple, just do the app in universal and then go to the target and then info and then add the main storyborad file base name (iPad) then build and run when iPhone is run to its show iPhone and when iPad run so show as iPad.

Related

Will releasing an iPhone app makes it available for iPad by default?

In my XCode's Targets summary screen, the "Devices" drop down is set to "iPhone" (other possible values are iPad and Universal) because I haven't fine tuned the app's UI for iPad. However, will people be able to download and run my app from the iPad in non-fullscreen? (e.g., with black border surrounding most of the screen)
I want people to be able to search for it in app store, install it, and run it even though it is not full screen.
Even though your device settings for app is iPhone, you can download it from iPad, but it can be viewed only as in iphone size or in 2x option is there on right bottom side of the app (refer image) to double the app size in ipad; but doubled view will look stretched.
An iphone app downloaded to ipad will look like as shown (In 1x mode).
If it's on the app store as an iPhone app then you can still run it on the iPad but they'll run in their original size unless you change the size to fit using the 1x or 2x icon. The graphics won't be as sharp and if your app uses any iPhone only features - make calls, then it's not going to work as expected.
If you want to get rid of the little iPhone app inside the iPad then you'll need to change the target to Universal in order to run as a native iPad app
What type build you use? XIB or Storyboard?
In any case go to the drop down menu and set Universal App, xcode create automatically the Xib or storyboard target for iPad, and the app run in full screen on iPad.
Ok now you have to setting up a new interface specific fo iPad:
if you use a xib files, you have to only resize the interface target for iPad.
if you use a Storyboard, in order you have to
Right click on your project and click on NewFile
add New Storyboard target fon iPad
Now you have a new storyboard for ipad, but is empty and not linked, so go to you project setting and set the new story under the iPad settings, click on iPhone Storyboard and pres CMD + A select all inside your storyboard for iPhone go to your storyboard for iPad and again CMD + A and press CANC Yes delete all inside a iPad Storyboard and press CMD + V now you have copy all your project correctly target for ipad but now you need to relink and resize all stuff.
Hope this help you and other people, do not forget vote up ;)

convert an ipad app to iphone app with custom views

This might be a repeat question.But i have a problem. I have an iPad app functional. The app is built in iOS 6. When i started building it i chose iPad as targeted device NOT universal. Now my client has asked for an iPhone version of it.In my iPad app i keep adding custom views as the client clicks "Add More".I add a custom view which is bunch of textfields, buttons etc.So i copied my iPad app and changed the Targeted device family to iPhone once and also Universal next time and tested it. So when i launch the app in iPhone configuration (keeping the targeted device family as Universal) my view controller stays like that on iPad. I cannot scroll the app also(not up/down..nor sideways). Is this the correct way to convert iPad app to iPhone app . Also everything is still with scale to iPad. Should i start a new project and start everything from scratch.Set the storyboard to fit according to iPhone configuration? In my research people said just change the targeted device family to Universal. But it doesn't work. Please let me know if you need more information. Thanks.
It is possible to convert the current project you have to an app that can be used universally, but it would take more time than simply just creating a new project that allows universal usage, and adding in the files of which you used for your iPad project.
Hint: You can use more than one storyboard when the project was created universally. It will automatically set this up for you.
I would also advise that you separate your files into what works universally, and what is specific for the iPhone or the iPad.
Happy Coding!
After many search i found that it possible to have an application for both Iphone and ipad devices.but in your code you should define unique ui for each device(two xib file).

Convert iPad app using Storyboard into iPhone app

I have one view which was created for iPad, using a Storyboard.
Now, I want to convert it to an iPhone app.
I am very new to Storyboards. Until now, I have been using separate XIB files.
Can you please explain to me the steps for doing this?
What you want to do is important, if you want your app to just run on both iphone and ipad, you can go to project Summary and then in devices select "Universal" option. This will just run your app in both iphone and ipad(full screen and not 2x). But if you want to look it better then you have to manage your UI assets accordingly.

iphone app only showing in little window on ipad

I have developped an iPhone app and I now need it to work on iPad. On the simulator the app only show in a little window (the x2 zoom enable the app to work in full screen) but is there a way to have the app directly showing in full screen ?
Thanks a lot,
Luc
go to project settings and set Targeted Device Family to iPhone/iPad
As Max said, go to project setting and set Target Device Family to iPhone/iPad. But this is not enough. With this change the application type will be universal application. This is good, because the app will start in full screen, but if you hard coded the dimensions of the views in the application then the look and feel on the iPad will be bad. So do the first step what Max suggested for you and then check if the app looks like you want, because it will not arrange the views automatically. You should do the changes from code or from nibs.
There is a little help if you set properly the autoresizing masks.
Edit:
Project menu -> Edit Project settings -> Targeted device family
You will need to do at least the following:
Change the Targeted Device Family to include the iPad.
Create or convert all needed .xibs for the iPad (using the Interface Builder Menu).
Reference the top level iPad .xib from your app's info.plist (using the NSMainNibFile~ipad key).
Handle the iPad paradigm wherever the controller or view source code needs to differ.

Customize iPhone view for iPad

I have converted a very simple iPhone app to Universal app. Now I need to customize the view on the iPad to use a higher resolution image for the background, move and resize some labels, etc.
How can I do it without changing the iPhone version? I can see that there is a new MainWindow-iPad.xib, but when I open in IB, it looks empty.
Thanks.
Did Xcode create other iPad specific nib files for you? If you are adding your view(s) to the mainWindow at application launch it will be those that need modifying.
If you are adding images programatically, you can use different resources per target. When you drag a resource into your Xcode project (say background.png) you can select which target to apply the resource to. So if you have an iPadResources folder, you can put your larger background.png into it and add it only to the iPad version. (Remember to GetInfo on the old resource, go to Targets and untick the iPad target).
Hope this helps