Reputation: 547
I has two UIViewControllers. SecondViewController is a ContainerView in FirstViewController.
I know how get access from First to Second, but have no idea how to do this opposite(Second to First). Maybe anyone knows how I can try to do this.
Thanks for all answers and ideas!
Upvotes: 1
Views: 36
Reputation: 968
You can set FirstViewController
as a delegate for SecondViewController
Upvotes: 0
Reputation: 1551
You can access the view controller by using the parent property.
if let vc = parent as? FirstViewController {
}
Upvotes: 1
Reputation: 13903
If SecondViewController
is properly set up as a contained (i.e. child) view controller, then its parent
property will point to FirstViewController
.
Upvotes: 1