Search code examples
iosswiftxibxcode-storyboard

Custom view (xib) not visible on storyboard


I have a custom view xib where I have multiple TableViews. I am loading this inside a ViewController as a nested view:

ViewController
   |_ View
       |_ View (This is where I load my Custom View)

When I run my app, I can see the empty tables on screen, so my xib is loading correctly.
So far so good.

My problem is, I am unable to see my tables in the storyboard. So I am not able to ctrl+drag and proceed further.

How can I see my custom view inside the storyboard view?


Solution

  • Storyboards can only contain ViewControllers and Segues. If you want to access something in your xib from the ViewController to set the delegates etc., then you have to do it from code. You can't, for example, set the delegate of a UITableView from within IB when the target ViewController is in a Storyboard and the UITableView is in another xib.