Customize iPhone view for iPad - iphone

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

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

Making two storyboards for iOS (iPhone and iPad)

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.

How to convert xcode 4.1 iPhone app in to ipad app

I was recently developed a big project on iPhone in Xcode version 4.1.
Now i need to convert this app for iPad.
I have verified so many links but all are regardig Xcode 3 ond it's extensions.
How to upgrade, how to resize the view etc etc
Please help me. Thanks in advance
Your best bet would be to create two new projects, one for iPhone, and the other universal and see what differences are in place there, especially the app delegates.
Quite a lot of the things won't be needed, however the app initialisation need some consideration, and most views tend to happily scale up to ipad resolutions without much or any additional work.
That was how I added iPad support into one of my apps I was writing anyway.
Depends how your app is build. If you are using Builder in XCode you can simply create new xib for each controller/view you have in app and name it with suffix ~ipad.
So if you for example have MyController.xib you will create MyController~ipad.xib and your controller will be loaded from this file automatically when run on iPad.
Changing the project preferences to universal gives you the possibility to specify a second MainWindow.xib in the info.plist file (Main Nib file base name (iPad)) which is the starting point for your iPad Interface. At this point running the app on an iphone would load your original interface and running on an iPad gives you the blank window once you created the corresponding blank MainWindow file.
Edit: You need also a second AppDelegate that holds the reference to your new window.

iPhone - How to transform an iPhone only app to universal app?

how can i transform an iPhone only app to an universal application?
EDIT : FOUND SOLUTION
If you want to have the "Upgrade current target to iPad" option selected, you must have Target Device Family set to iPhone only, not iPad/iPhone. It works for me!
If you want to do it manually, first create a dummy/template Universal app, look at the differences between it and your app, and change your app to eliminate those differences. Among the steps:
Create iPad subdirectories.
Create suitable xibs for the iPad in that subdirectory. Interface Builder has a menu item to convert generic .xibs automatically.
Modify your info.plist (add the NSMainNibFile~ipad key) to use an iPad xib for the iPad main window. Also add appropriate icons, etc. to this plist.
Either create new subclasses for the iPad, or use modify your existing subclasses to check the UI paradigm and select the appropriate UI subelements & sizes in code. You can check in code using something like:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
...
} else {
... // iPhone stuff, etc.
}
If you created new classes, plug them into the iPad xibs as needed.
Modify all your Target settings to build for iPad and iPhone.
"The first step is to select your target in Xcode, right-click and use the “Upgrade Current Target for iPad…” command. You will presented with a choice:
Select “One Universal application” and Xcode will do (some) of the hard work for us. The Apple guidelines warn against trying to manually migrate your target though to be honest it is hard to really see why. Also note that if your project has more than one target you can only run the upgrade task once. You will need to check all of your targets and adjust the build and Info.plist settings yourself."
http://useyourloaf.com/blog/2010/4/7/converting-to-a-universal-app-part-i.html

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.