Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple views in Xcode storyboard view controller, one of them won't appear in storyboard editor

I'm having trouble updating a project someone else created in Xcode. This is an app built in storyboard and in one case, there is a scene with a view controller that has multiple views underneath it in the document outline palette of the storyboard editor (shown in included image). The first view is the one that becomes highlighted in the storyboard editor when it is clicked on, and as you change the design or the objects in the view that view is updated. There is a second view (the one beneath exit and first responder) that is somehow attached to that scene but I cannot figure out how to edit the design of that view. If I click on that view or any of it's children, I can clearly see their attributes in the various inspectors on the right hand side (connections, attributes, etc.).

(edit 1 - the original version of this question suggested that these additional views were used for special layouts needed when switching to landscape. They are actually used more generally than that, for example, when displaying popups over the active view.)

In any event, my primary interest is in being able to modify this second view. It seems like there must be a way to see it in the editor and I'm just missing it. I've searched for tutorials on implementing portrait and landscape views in storyboards (none seem to use this method), for phrases like "multiple views in storyboard scene", and looked through the menu options (including a promising option "unembed" when the second view is selected, but when clicked it removes the view from the scene and then I can't find it). I'm at a loss of where to look to learn more. How can I edit this view? Any help is appreciated.

ViewController scene in document outline

like image 488
Chris Hart Avatar asked Nov 26 '12 01:11

Chris Hart


People also ask

How do I add a view controller in storyboard?

To create a new view controller, select File->New->File and select a Cocoa Touch Class. Choose whether to create it with Swift or Objective-C and inherit from UIViewController . Don't create it with a xib (a separate Interface Builder file), as you will most likely add it to an existing storyboard.

Can we use multiple storyboards in one application?

A storyboard is meant to explain a story, not a saga. An app's storyboard can be easily divided into multiple storyboards, with each one representing an individual story.

How does Main storyboard connect 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.


1 Answers

I know it makes no sense, but you can drag it into the first view (temporarily) to edit it via the storyboard. I think this is absurd, but it does work.

enter image description here

like image 168
jhilgert00 Avatar answered Oct 21 '22 15:10

jhilgert00