1

I followed a tutorial at Udacity to create an iPhone app and I am not only able to run it on an iPhone as I can in an iPad, that's fine. Nevertheless, the screen looks weird on an iPad. In my storyboard, if it is selected "compact,any" and if I changed it to "any, any" it should work, I think, but the elements in the "company, any" format do not come automatically.

I looked it up on google and found http://pinkstone.co.uk/how-to-convert-your-iphone-storyboard-into-an-ipad-storyboard/ - but this is for Xcode 6. I followed the steps:

  • change from iPhone to Universal in the project settings
  • duplicate storyboard file using Finder
  • Add new storyboard file to project
  • He says to use a button called "Apply Retina 3.5-inch Form Factor" whose icon looks like a person, but it is does not appear in Xcode 7.2. I think that was changed to the "any,any" options that appear on the bottom.
  • Change part of xml code of storyboard from targetRuntime="iOS.CocoaTouch" to targetRuntime="iOS.CocoaTouch.iPad"

The steps below just made "compact,any" to "any,any" in the new file but with no buttons, views or labels of the "compact,any". Is there a way to do that? I tried copying and pasting also... but it didn't work quite well somehow... maybe I did it wrong. I am also wondering if I do need to create a new storyboard file. It seems like the "compact,any" is somehow independent of "any,any" and the same file would work for iPhone and iPad.

I am using only Swift for the development language, although I don't think this is relevant for the layout.

That's what I have thought regarding the question.

1

1 Answer 1

1

Answer to your question: You have to create them for each size class, individually.

Explanation: Your constraints and items in your storyboard are created for a custom size class. You cannot just "copy" your constraints from one size class (compact, any) to another (any, any).

Your question title isn't accurate- you're not asking how to "convert" an app from iPhone to Universal (which means it can be used on iPhone and iPad). You've done that already- in your project settings, so it is now "converted" to be a universal app (even though it's useless to you on an iPad, it is still "supported")- and you've answered your own question.

What you're asking (I think) is how to copy your elements and constraints to another size class, which you can't just "copy". What your question should be is this:

"Convert storyboard views from (compact,any) size class to (any,any) size class" to which there is no easy way- it must be done manually.

Your question is a potential duplicate of many others I found. Here is a related question that has an answer that might help you.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.