Convert ipad application to iphone. Universal app - iphone

Convert iPad application to iPhone- Universal app.
I already have one iPad application, now I want to make a universal app of that iPad application.
How to convert? Is it possible? Or do I have to start a new app?

Open up your project in Interface Builder. Click on the disclosure triangle next to "Targets", then right-click on the target and choose "Upgrade Current Target for iPad...".
Then read the iPad Programming Guide, especially the section Starting Your Project.
Edit:
I see now -- iPad to iPad/iPhone.
I think you would do something like the following:
Create a .xib for the iPhone for the
Main Window/App Delegate/etc, to
corresspond your existing .xib for
iPad.
Add an entry in your info plist:
NSMainNibFile, with the value of the
name of your new iPhone xib
Go to your build settings and set
the Base SDK to 4.1 (or 4.0 if you
still have the older SDK installed)
Keep your iOS Deployment Target
build setting at 3.2 if you're only
worried about iPhones and iPod
Touches with 4.x.
Set the Targeted Device Family build
setting to iPhone/iPad
Start refactoring your code to
create two different code paths, one
for iPhone and one for iPad, where
appropriate.

Related

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

App targeted for both iPad and iPhone; removing iPad component pre-release

I'm about to release an app that I have been working on for quite some time and is has currently been built to target both iPhone and iPad. The app has both iPhone and iPad storyboards and various device specific code and views. I now wish to remove the iPad references and release the app targeted for iPhone only.
Can a project be changed in this way without too much difficulty and what are the potential complications that may arise?
You should be able to change the device target in Xcode to just iPhone, then verify the build runs in the iPhone simulator window on the iPad. You can also check the bundle plist to verify that UIDeviceTarget contains only 1, not 1 and 2.
If you want to remove the iPad resources, click on your storyboard (or other files), check the properties pane, and uncheck the target. This will stop the file from being copied into the app bundle.
In this image you can see Devices is selected for iPhone only. You can change it from here.

Problems with Universal iPhone/ipad app build

I have created a Universal (iPhone/ipad) application .I have created separate Xib designs for iPhone and iPad both works well. When i build the app it should give a single .APP(build).I installed in iPhone and iPad tested correctly.
Now i want to give a two separate builds (for user to test), one for iPhone and another one for iPad.So in project settings i changed a target device family (iPhone/ipad -> into iPhone) and (iPhone/ipad -> into iPad). So it gives two separate builds.One for iPhone and another one for iPad.
My problem is when i build with iPhone(as target device family) and installed in iPad means it loads a iPad design not an iPhone design.What could be the mistake i did here ? I search a lot and could not find any solution.
If any one did like this? or do it for me?(testing)
Thanks in advance.....
It's because (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) if you run iPhone-designed app on iPad. And thats why iPad version of xib file is selected. So you need to attach correct .xib file manually, or exclude iPad version of it from iPhone resources.
The tester can install the same build in both iPhone and iPad. The concept of universal build is that, the same app will work on both iPad and iPhone.

change iphone project to work in both iphone and ipad

I already have an application which i have built for iphone only. I need to change it to work in both iphone and ipad.the upgrade to ipad application option in project tab of xcode is faded.. which I means I cant do that... I tried to run the project in ipad simulator but it gets automatically run in iphone simulator.
What are the proper steps to change my project to work in iphone and ipad.
Initially change the build setting,ie change the Targeted Device Family field to iPhone/iPad. To write logic for iPad use "UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad" this condition.

Downgrading iPad app to iPhone app

We can upgrade an iPhone project to iPad project as mentioned in the link:
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/120-Building_and_Running_Applications/building_and_running_applications.html
But, I am having an project that is created for iPad. Now, I want to create another target for iPhone (supporting OS same as iPad). How do I do this?
Thanks and Regards,
Deepa
You probably do not want to create a new target for iPhone. What you want is to have a single target that creates a universal application that runs on both iPad and iPhone/iPod touch.
First go to the project settings and change the setting for "Target Device Family" from "iPad" to "iPhone/iPad".
Secondly you will also need two MainMenu.nibs, one for iPad and one for iPhone. You do this in the Info.plist for your target. The key NSMainNibFile should name the nib for iPHone, add a key named NSMainNibFile~iPad to name the nib for iPad.
Now the app is ready to run on both devices, (until you try to use UIPopoverController or other iPad specific class on the phone). Rest of the work is just to make it pleasant, one view at the time.
Use the run-time check [UIDevice currentDevice].userInterfaceIdiom to check at run-time what kind of device you are running. To choose different nibs to load, and other user experience differences.