Storyboard not loading GUI but still compiling [duplicate] - ios

This question already has answers here:
why storyboard ui elements not showing on UIViewController in xcode 6?
(5 answers)
Closed 7 years ago.
I am building an application and just switched the computer the files were originally housed on. Now the app will still build and it looks exactly as it should, but the storyboard in xCode is full of a bunch of blank views. Any help would be appreciated. Thanks!

You probably designed your storyboard in a specific size class. Thus, all those views are conditional for that size class. Now, however, you've opened the project on a different computer, and the storyboard is showing the universal w:Any h:Any setting. Thus, all those views are missing. The app still works, though, because when it runs, the app is in the size class environment for which you designed it, and so the views appear.
To see the views in the storyboard, switch the storyboard to whatever that specific size class is.

Related

Xcode 10 - iPhone X black bars [duplicate]

This question already has answers here:
Seeing black bars at the top and bottom of the iPhone X Simulator
(11 answers)
Closed 4 years ago.
I have been searching for days now and I am really going crazy.
I have re-openend an old project last edited with xcode 9 (I did not care about the iPhone X screen until now) in my freshly updated Xcode 10.
No matter what I do I can't get my app to use the whole screen for iPhone X.
At first I noticed I was not using safe area layout guide - ok, added it for a test view, still black bars.
I'm using storyboards and have set up a test storyboard with no view controller or something else, only a single view inside the safe area and yellow background. This storyboard I have set to be the main interface.
In project settings I have enabled "Requires full screen".
In Xcode Editor everything looks good:
However, the result in simulator (and also on a friends real iPhone X) is like this:
Is someone able to help? This does NOT happen when I create a new project, but of course I would very much like to avoid using this option as the app is almost completely developed....
Thanks,
Matt
Thanks to rmaddy I changed from launch screen image to storyboard and the problem disappeared... how stupid of me to ignore that while googling.. :)

Xcode8 Controllers are Grey which are designed in Xcode 7 with size classes

I am making my iOS Application Compatible with iPad.I have designed the UI of my Application with Xcode 7 with size classes which is more specifically designed for iPhone, Now i have to upgrade it to support iPad also.
Now with Xcode 8 when i select iPad from Storyboard with Device Pan then most of the controller are Greyed i.e. those controllers are not showing on iPad on the device also and on the Storyboard also. Please check the screenshot for that
I know the reason why they greyed out, because they are designed with size classes for a different size.
Now my question is, is it possible somehow to use this controller for iPad without Redesigning the UI and updating the Auto layouts, as of now i am not seeing any way to make this controllers available for iPad.
Also i have tried with a way but i think that will be very long, I have to delete this controllers and then add it back and set the layouts again.
Also another way would be design separate storyboard.
So please suggest me what will be a better solution to overcome from this.
Thanks
Even after compatibility conversion to Xcode 8, if still it doesn't seem to work, then you need to check if there are any leftovers like below:
If you want to make sure it works with any width and height, find the constraint:
and remove it by clicking on the x, leaving only installed checked:
That should solve it for Xcode 8.

Convert only iPhone App to Universal App in Xcode 7.2

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

How to avoid using storyboards for ios apps? [duplicate]

This question already has answers here:
Xcode 6 - Template without Storyboards
(3 answers)
Closed 7 years ago.
I am learning iOS developpement (reading the Big Nerd Ranch Guide) and I want to learn using only my iPhone 5S as a test device. I am using Xcode 6.3.
However, as a beginner, I don't want to get involved with storyboards (which are besides seen as bad by some developers) and autolayout stuff. But, by default xcode does use that new feature and my windows are split when I run my sample apps on my iPhone.
How can I prevent it from doing so and use classic xib files for my iphone 5S?
You can assign your UIViewController subclass instance to window.rootViewController in AppDelegate and then take it from there.
Your project's Info.plist has a key "Main storyboard file base name". Remove that entry from the plist, and then delete the storyboard.
FWIW, storyboards aren't bad. In fact AutoLayout is much easier done in Storyboard than in code.

iphone-Xcode 5 xib/storyboard Problems

Okay- I have this space shooter app based on uiimageviews. Originally, I made it on Xcode 3. Then, I converted it to Xcode 4. However, I did not use story mode. I stuck with the .xib files and it worked fine after I edited some of the basic code around. Then, when Xcode 5 came out, I couldn't do that anymore. When I tested my app on the iPad, most of the screen was grey and only the top corner had my game in it. I would like it to be able to auto size using just the xib files. Also, with the 4 inch and 3.5 inch iPhones, how can i make a view that fits them all? I tried storyboard, but my app was based on .xib files. It is one view controller, but it loads a lot of different .xib 's. What is my solution?
The solution is to switch your app from universal to just iPhone.
You can find a solution to a problem, similar to the one you are having, in the following stackoverflow How to convert a project using XIBs to Storyboard?

Resources