Q:

How to pass data and segue to a view controller embedded in a navigation controller in a different tab in Swift?

When the user presses a button  ViewController1, I would like to segue to ViewController2 and pass data to it. In all the methods I've tried either the NavigationController disappears or the TabBar disappears, which I don't want. Is there a better way to bring the user from ViewController1 to ViewController2?. 

A:

Insert a NavigationViewController in between TabBarController and ViewController1. Then perform segue from viewController1 to viewController2 and pass the data using prepare function

