Note that there are some explanatory texts on larger screens.

plurals
  1. POIs Interaction Between Presented/Presenting View Controllers and Parent/Child View Controllers Documented Anywhere?
    primarykey
    data
    text
    <p>Reading the documentation on the changes to UIViewControllers in iOS, I trying to figure out how the interaction between presenting modal view controllers works inside of a custom container view controller. Ultimately, what I would like to be able to do is reliably walk through a chain of presented view controllers, even if some of those controllers are being presented by child view controllers.</p> <p>(I am working on a library, not on an app, so I am not creating the hierarchies I will be interacting with. I am simply trying to ensure that my library will work correctly within different types of hierarchies.)</p> <p>So my question is boils down to, what happens when someone tries to present a view controller from a child view controller?</p> <pre><code>[childViewController presentViewController:viewController animated:YES completion:nil]; </code></pre> <p>Since a presented view controller is intended to "take over" interaction until it is dismissed, it would make sense to me that the presentation request would be forward to its parent (or actually, up the chain of parentViewControllers until it reaches a view controller with no parentViewController) and then be displayed from that view controller. Otherwise, it seems as if the developer could do things like present modal view controllers from two different children, etc. which seems to me problematic. (Which presented view controller would take precedence, for example?).</p> <p>Furthermore, if the above were true, it seems like it would have some implications. If the parent view controller is displaying a presented view controller, what would this return?</p> <pre><code>[childViewController presentedViewController]; </code></pre> <p>Would it be <code>nil</code> because the parent is displaying it? Or could this request be forwarded to the parent, so that the <code>parentViewController</code> and any of its <code>childViewControllers</code> would all have the same results?</p> <p>Anyway, I have a sample project ready to go to start running some scenarios, but I am curious if there is any documentation I have missed? Or if someone already knows about the way that this interaction takes place?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload