Reading the documentation of the changes to the UIViewControllers in iOS, I’m trying to understand how the interaction between the view of modal view controllers works inside a custom container view controller. Ultimately, what I would like to do is to reliably go through the chain of presented view controllers, even if some of these controllers are represented by child-view controllers.
(I am working on a library, not an application, so I am not creating hierarchies with which I will interact. I am simply trying to ensure that my library works correctly in different types of hierarchy.)
So my question comes down to what happens when someone tries to present a view controller from a child view controller?
[childViewController presentViewController:viewController animated:YES completion:nil]
Since the presented view controller is designed to “capture” the interaction before it is fired, it would be reasonable for me to submit the view request to its parent (or, in fact, up the chain of parentViewControllers until it reaches the view controller without parental control), and then will be displayed from this controller. Otherwise, it seems that the developer can do things like modern modal view controllers from two different children, etc., which seem problematic to me. (For example, which view manager is represented, for example?).
, , , . , ?
[childViewController presentedViewController]
nil, ? , parentViewController childViewControllers ?
, , , , , - , ? - , ?