Showing views in interface builder outside viewcon

2019-07-29 04:06发布

问题:

I often make use of views in interface builder that live outside of the viewcontroller hierarchy (see screen grab below for simple example).

Before upgrading to Xcode5 I could get this view to appear on the storyboard by writing an IBAction outlet and dragging a connection from the code to the view in the storyboard.

If you paused over the button for a moment it would flash and then open up as a view on the storyboard that is then a lot easier to work with.

Since upgrading this function no longer seems available. Has anyone found out how to get these views to appear on the storyboard?

Edit: Using the temporary viewcontroller as described in this answer seems one approach, although fiddly since you need to move the UIView stack between viewcontrollers each time you want to edit the layout. Using a separate XIB is starting to seem like the sanest approach.

https://stackoverflow.com/a/13713385/1060154

回答1:

Finally, we get this back in Xcode 7. Hallelu!