UIView outside of a View Controller in a Storyboard UIView outside of a View Controller in a Storyboard ios ios

UIView outside of a View Controller in a Storyboard


It appears there is no way to do it. See Jason's comment and this question addressing the same problem, though in a different context.

However, I realised earlier when thinking about the implications of my problem — as I began to explain in my previous comment before deciding it would be worth a full answer — it makes sense to separate the design of a custom view from the design of an application flow. So the fact that it's not possible to design custom views in Storyboards may very well be... by design.

A custom view (which is a reusable component) is very different from a view controller (which represents a scene in your application storyboard). It's the same as a character and a scene, in a movie. You don't want to design your character in your scene, even if you happen to use that character in only one scene. It's fortuitous if you use it in only one scene, but not essential. So it has to be separate.

The fact that you want to use Interface Builder to design your custom view is only an implementation detail that should be encapsulated in your class. The application storyboard has no need of knowing, even less managing, how you deal with the particular implementation of your reusable view.

Hmm, I wish I had more of this brand of interrogation :)


You can use a Container View, is like a regular view(You can assign a IBOutlet UIView) but you can define it outside of your UIViewController.

The "container view" is outside the view, but i can assign it to a IBOutlet UIViewYou can design it


I was wondering the same thing myself, and actually was able to get this to happen, though after messing around, its gone. I have a Nav Controller, a View Controller and two views. I had developed the views in a separate nib, and imported them to this project. While was was connecting buttons, the view I was working in suddenly appeared next to my View Controller. Unfortunately, while trying to get the other view to appear, I somehow lost it, and dont know how to get it back. It doesnt seem like you can drag a view to the storyboard, only into a view controller. However, if I was able to do it once, its got to be reproduceable.