Search code examples
xcodeinterface-builderuistoryboardxcode-storyboardtvos

Multiple UIViewControllers in a tvOS Storyboard Scene


I'm trying to create a storyboard scene for tvOS where a UIViewController has an embedded UITableViewController. I'm unable to make the connection, though, and I'm not sure if I'm doing something wrong.

At present, I have a UIViewController scene, and a separate UITableViewController scene. The UIViewController scene has a UITableView within it. When I try to make an "embed" connection from the UIViewController to the UITableViewController, I can't select anything else in the Document Outline. I tried adding another UITableViewController to the main scene's dock, and it will only let me drop it onto the canvas, not as a part of the main scene.

I haven't done this with iOS yet, so I'm not sure if what I'm trying is supposed to work, and it's a bug I need to report, or if I'm taking the wrong approach.


Solution

  • Embed segues can't be created from a "normal" UIView, you need to set it from a ContainerView class that you need to drop into your UIViewController.