Flipacholas Flipacholas - 7 months ago 86
Swift Question

Communication between navigation controller and container view

View Controller
| |
| |
| | Navigation Cont.
|_________________| _________________
| | | |
| | | |
| Container View | --> | | --> Child View Controllers
| | | |
|_________________| |_________________|

My app has a navigation structure composed by a parent view controller and a container that contains a navigation controller (and its child view controllers). The problems is that during the initialisation of these child View Controllers I want to pass some values provided by the Parent View controller. Unfortunately the method
used in the parent only detects the container segue but its not called when the child view controllers are changing.

How could this problem be addressed? I'm using Swift but I also understand Objective-C.


Well, at the end it took time... but I finally got it. It's simple: the child will talk with the parent over self.parentview.parentview. A couple of delegates and it's done.