0
votes

I would greatly appreciate it if someone would help me with adding segues to multiple view controllers using prepareForSegue(_:sender:).

My project is similar in structure to this tutorial.

This is a good tutorial, however all the menu options link to one view controller.

I'm trying to enhance the project by adding additional view controllers, instead of the one DetailViewController, when an individual selects the table menu cells or menu items.

How might one create several segues from that container, giving them different segue identifiers from the UITableViewCell / menu items to the multiple view controllers?

1
Ok, here are my initial thoughts for a possible high-level solution. First, my new VCs need navbars, so I've embedded new VCs in nav controllers and I'm adding segues to the corresponding nav controllers. Second, I think it's possible to create several container segues from ContainerViewController.swift, giving them different segue identifiers. Next, the table view is dynamic, but I think it may need to change to a static table view. Then I’m hoping to assign different show segues from those static cells (as opposed to the the view controller that has the UITableViewCell). Any thoughts? - mvien
I've tried the above so far and haven't been able to get it to work. What's the best way to go about this? - mvien

1 Answers

1
votes

Got it! Updated the MenuItems.plist with storyboardIDs and then added the IDs to each of the new view controllers. Then I added code to instantiate instances for each of the new child view controllers in the DetailViewController class. Works like a charm.