Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why storyboard ui elements not showing on UIViewController in xcode 6?

Tags:

ios

ios8

I am new to IOS development. I am developing an app for IOS 8 devices. I used storyboard for my design yesterday my storyboard showing all UI design but today morning it show blank UIViewController no UI element vision please see in screen shot and very strange thing is that when i run my app all ui element visible in my device. I google but dont find any solution please help me out. Thank you in advance.

enter image description here

like image 881
nishitpatel Avatar asked Nov 29 '14 03:11

nishitpatel


People also ask

Why is Main storyboard not showing up in Xcode?

You have SwiftUI enabled in your project, which does not use storyboards anymore. Your layout is inside the ContentView. swift file. If you do want to work the old way, with storyboards, you should uncheck 'Use SwiftUI' in the project creation screen.

How do I show storyboard in Xcode?

To get this, open the storyboard, click the 'assistant' editor, click the 'assistant editor menu button' (immediately to the right of the > arrow at the top left of the assistant window) and select Preview.

How do I connect storyboard to ViewController?

Create a new IBOutlet called shakeButton for your storyboard button in your ViewController. swift file. Select the shake button in Interface Builder. Then hold down the control button ( ⌃ ) and click-drag from the storyboard button into your ViewController.


2 Answers

It looks to me like you are using size class and you went into a particular size class and added these views. Now you are back in Any size class, so the views are not there (that is why they are greyed out in the document outline at the left). They are available only for that particular size class. If you switch back to it again, whatever it was, you will see them again. Basically, you have created conditional views - the condition being that they are present only when that particular size class situation is the case.

In other words, if you want your layout to apply in the general case, you want to start by creating and editing it under Any size classes. Only then do you switch to a particular size class and modify the layout for that particular size class.

when i run my app all ui element visible in my device

Yes, because on your device the particular size class situation matches the size class you were editing when you added those views. So there they are. That seems to me to prove my guess is right.

like image 66
matt Avatar answered Sep 21 '22 13:09

matt


I have the same issue while copy a ViewController to another storyboard.

Fixed by following steps:

1: Select the viewController

2: Click on 5th Tab

3: Set the simulated size to Fixed.

enter image description here

like image 29
guru Avatar answered Sep 21 '22 13:09

guru