Dom Bryan
Dom Bryan

Reputation: 1268

Swift: Segue to a view programmatically from an alternate view

I have a master view, I have added in a menu (TableView) that slides out on an IBOutlet. This menu is controlled by another view controller. The master view is segued to multiple other views but I am having huge problems segueing from the menu view (TableView) because it is in another view controller.

How can I segue from master view to another view from my table which is controlled from yet another view controller?

Note: I am also having to carry over some information from master view to the other views, but I when ever I have tried to segue from the menu, the new views error and tell me they unexpectedly found nil while unwrapping optionals.

Upvotes: 0

Views: 139

Answers (1)

Phillip Mills
Phillip Mills

Reputation: 31026

Have your menu only post a notification when something is selected. Have the view controller that's the source of the segue (master?) listen for the matching notification(s) and perform the segue.

Upvotes: 1

Related Questions