If a storyboard contains a view in a navigation controller that segues to another view controller already embedded in a tab controller how can a variable be passed from the initial view to the first view in a tab controller?
Specifically, I am looking to pass a variable using a basic performSegueWithIdentifier
approach. By connecting the first view controller (embedded in a navigation controller) to the tab controller, I am unable to pass the data. However, if the connection is made directly between the first view controller and the destination view controller, the destination is no longer embedded in the tab.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "internalItemDetail" {
let destination = segue.destinationViewController as InternalInventoryDetail
let index = itemTable.indexPathForSelectedRow()!
destination.fmRecordId = sectionedItemArray[index.section][index.row]["fmRecordId"] as String!
}
}
To be clear, the goal is to pass a variable from a navigation controller into another view which is embedded in a tab controller while the UI would be showing a tab controller inside a navigation controller.