I would like to design a UIView, which is larger than a ViewController in Storyboard (iOS 5).
The UIView should be used as the subview of a UIScrollView and hence be larger than any of my existing ViewControllers. How can I create such a UIView in Storyboard and associate it with my UIScrollView?
I would like to do this without xib files if possible.
Thank you!
I've found the way to edit the view added to the scene (being at the same hierarchy level as ViewController).
Unfortunately it is from
hackish
types of actions. MyXcode
version isVersion 4.5.2 (4G2008a)
. I've tested this in real project and new empty project.The basic idea is that
Xcode
do have an ability to edit such external views, unfortunately this mode doesn't activate straightforwardly.In the method that I've found you need to have 2 levels of hierarchy inside your external view:
Document Outline
panelSubView2
in the tree of your sceneThe editing area will appear and its coordinates will be saved to project's user data, so you can move it to more suitable place if you want to, and next time you'll open the storyboard in IB on the machine it will be there. Although I think on other machines you'll have to do it again (I haven't tested that).
I see no other option than using xibs, but it's not that annoying:
In order to make IB connections you can set the
filesOwner
class in the xib to be your viewController, and connect like usual.You can place a
UIView
into your scrollview and directly design it inside theviewController
of yourscrollView