Convert simple iPhone app to Universal app - iphone

I have very simple iPhone app, which uses just UIButtons, UIlabels, UITableView. without any custom controllers and graphics. How can I convert app to universal with that UI?

First update the application target device to Universal.
Update the application target device to Universal.
Check the Info.plist for NSMainNibFile & NSMainNibFile~ipad keys.
For all other views, have two different NIB. For example FirstView.xib & FirstView~ipad.xib. iOS runtime will load the proper view based on the device.
Here is a screenshot of a sample project:

I needed to convert my iPhone App to iPad yesterday and found the easiest way to do it as long as your app is pretty simple. Mine was literally just some tableViews that were set to auto-size. In Targets / Devices just change it from 'iPhone' to 'Universal' and then build your application. This worked very nicely for me. All tableViews were perfectly formatted for the iPad and that is really all I needed.
Note that if you had any other XIB files that were not just tableViews, such as a window with text fields, all you have to do is set them each to resize properly so they stretch and stay at the top and your simple app should be pretty much all set for the iPad.
Obviously you'll need to test it and tweak anything needed but for the most part the above worked magically for me and took literally one second to convert my iPhone app to an iPad app!

Related

going from Iphone to ipad

I've created full app for iPhone, but I need to make iPad version. mostly the app is lists, but login screen, logo and cells are too small (just to repeat - it was created for iPhone). Is there any way to create iPad user interface or stretch phone views?
Thatnks for your help. Btw sorry if it's duplicate of some similar question. Just couldn't find it (maybe bad keywords).
You absolutely should have separate XIBs for iPad & iPhone. Now, if you want to try and save some work and start from the iPhone XIBs as your base point, you should take a look at the top two answers from this question:
Xcode 4 .xib Create iPad Version

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).

Running a universal app as a scaled iPhone app?

I've seen tons of questions and answers regarding merging an iPhone and an iPad app into an universal app, but that isn't what I want to do. What I am going to do is use in app purchase to unlock an iPad interface and then display the correct interface using conditionals. If the interface is purchased, the app displays the iPad Nib, and if not, it just displays the same way as an iPhone application does (with the option to scale the app, etc). The conditionals are very simple and I have already implemented them, however the issue I run into is this: If the IAP is NOT purchased, the iPad displays the iPhone Nib, but not in the typical way. It is just in the corner with no option to scale it, rather than in the center with the black border that you usually see. Does anyone know how I can set it up so i fixes this issue? I'm a little stumped to be honest.
The Info.plist file in an iOS app contains a key, UIDeviceFamily, which lists the devices that the app natively supports. If the key's value is 1, or a array containing 1, the app natively supports iPhones and iPods Touch. If the value is 2, or a array containing 2, the app natively supports iPads.
If UIDeviceFamily says the app supports iPads, then it will run the app in native iPad mode, not in iPhone-wrapper mode.
The Info.plist file is part of your app bundle, and you can't modify files in the app bundle.
So there is no way to enable or disable the system's native-iPad support at runtime. You'll have to move your app's top-level view into a wrapper view that centers and scales its child, and use that wrapper view as the UIWindow's subview.
UIDeviceFamily in the Information Property List Key Reference
This isn't possible, unfortunately. The iPad will know that the app is iPad ready and will tell draw the screen at full size. Even if you showed iPhone xib file on the iPad, they would still be scaled to fit the full screen using the UIViewAutoresizingMask params you've set for them.
One thought would be to force the size of your UIWindow to be iPhone sized (remember to account for retina) and centered, but I'm not 100% sure how/if this would work. You may have to change each UIView frame. I'm not sure.

Converting an iPhone app to an iPad app in XCode 4

I had created an iPhone app long time back. Now I want to kind of convert the same into an iPad app (the code would more or less remain the same, I only want to redesign the xib for iPad size).
Now I am using XCode 4 and after opening the app, I changed the devices to iPad. But my .xib are still showing iPhone size.
It created an iPad folder (just like Classes/Resources/Products...).
Also to add, the app now opens an iPad simulator, but let's say I have a UIWebView which just stretches to iPhone size (as in IB) and not the complete iPad size...
How and where do I redesign the xib for iPad ? What are the updates to be made when we just change the devices from iPhone to iPad ? Also I guess an iPhone app would work on iPad (using 2x), but the reverse is not true.
You should look into creating a Universal app which basically has shared code and libraries for the iPhone and iPad but different view layers (views or XIBs).
In that model you have different interfaces for both which you should. The paradigms are different - in iPhone you have small real estate so you have navigators that drill in and pop out. In iPad, you have more real estate so you have master/detail splitter views with pop-over controls. As you pointed out, even the web views are different sizes at a minimum.
If you start fresh you can create a universal app and get a feel for how it's laid out. File, new project, iOS, pick app type, next. For device family select Universal.
If you are converting, there's some resources out there. Here's some:
http://useyourloaf.com/blog/2010/4/7/converting-to-a-universal-app-part-i.html
How to convert iPhone app to universal in xcode4, if I previously converted, but deleted MainWindow-iPad?
Convert simple iPhone app to Universal app
I find it easiest to open the xibs in the separate Interface Builder that came with previous (3.2?) XCode and use its "convert to iPad using autoresize masks" option. Then I include the new separate XIBS in the project and do conditional loading (eg - use the UI_USER_INTERFACE_IDIOM() makro to load one xib or another.)

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.