Reputation: 14904
I have the following problem:
I would like to pass some data to my rootViewController, from an UINavigationController in an Popover. My popover is here:
var popoverNavigationController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("popoverNavigationController") as! PopoverNavigationController
When ill open that controller with:
popoverController.modalPresentationStyle = UIModalPresentationStyle.Popover
self.presentViewController(popoverController, animated: true, completion: nil)
There is a rootViewcontroller, with a certain class - how could i append data from the NavigationController to its rootViewController?
For example:
popoverController.text = "1234"
How can i push this value to the rootViewController? The NavigationController is initialized by the Storyboard.
Thanks in advance.
Upvotes: 0
Views: 673
Reputation: 14040
if i got you right in your navigationcontroller you could do something like this:
if let rootViewController = viewControllers.first as? PopoverAddItemsViewController {
rootViewController.text = "1234"
}
Upvotes: 1