8

I have drag & drop UIView to UIViewController in storyboard in xcode 5, it's added but i can't see that UIView in storyboard. Any one have solution?

In previous version of xcode, i did get it worked with the process described from following link:- https://stackoverflow.com/a/14515818/952440

But now it did not work in latest xcode 5.

For your information i have added screenshot from storyboard below:-

Screenshot of document outline

Screenshot of bottom part of view controller

Community
  • 1
  • 1
Sunil Zalavadiya
  • 1,993
  • 25
  • 36

3 Answers3

0

You have to add these views as subviews of the main view. Just drag them into the top View.

If you don't want to show them by default, set them as hidden and show them dynamically.

To edit them, you could create them in a separate xib and then copy-paste. That being said, I do not recommend to put views into storyboard that are not part of the application flow (the "story"). That is what xibs are for. If, however, the views really belong to this controller, then add them as subviews as suggested above.

Abhinav
  • 37,684
  • 43
  • 191
  • 309
Mundi
  • 79,884
  • 17
  • 117
  • 140
  • 2
    You can still drag them outside of your main view as in Sunil's image, but I haven't found a way to modify them without dragging them into the main view (a huge oversight IMO). – powerj1984 Sep 21 '13 at 11:49
  • 1
    I do not want to add UIView as subview to the main view, I want to add & modify it separately. It was worked in earlier version of xcode, but now in xcode 5, it is not working. – Sunil Zalavadiya Sep 21 '13 at 12:04
  • I don't get it. Then what is wrong with the screenshot above? The views are on the same level as the main `view`. This works exactly the same in Xcode 4 and 5. – Mundi Sep 21 '13 at 12:16
  • @Mundi I mean to say that if i add another UIView as a subview of main view it works fine, But I want to drag & drop another UIView outside the main ViewController's View. – Sunil Zalavadiya Sep 21 '13 at 12:35
  • In understand that - but that is what you are doing. So what is not working? – Mundi Sep 21 '13 at 12:44
  • @Mundi ya, I added it outside but when I double click it in left pane it's not showing in right pane (i.e centre editor part where we can update views). – Sunil Zalavadiya Sep 21 '13 at 12:52
  • Here is a workaround: create a xib to edit the views, then copy-paste. – Mundi Sep 21 '13 at 21:17
0

First of all your custom views "forgotPasswordView" and "SignUpView" must be subviews of your viewcontroller's view (LoginSignUp View Controller). From the screenshot it appears to lie outside and that is why they are not appearing up. You can simply drag and drop them at right place.

Additionally, make sure in your custom view classes you are implementing "initWithCode" initialization method for any initialization code.

Also see for reference:

How can I make my UIView visible in Xcode's Storyboard editor?

Community
  • 1
  • 1
Abhinav
  • 37,684
  • 43
  • 191
  • 309
0

Now, we can see view outside of UIViewController in storyboard in Xcode 7.

For your information i have added screenshot from Xcode 7.1 storyboard below:-

enter image description here

enter image description here

Sunil Zalavadiya
  • 1,993
  • 25
  • 36