Why and how
Say, viewing controller A introduced B, and B, in turn, introduced C.
When you call dismissViewControllerAnimated:completion:, iOS checks to see if the controller of the view you are calling it has a child in the property presentedViewController. If so, then it rejects this controller.
So, if I call him B in our example, he will reject C, but if I call him A, he will reject B (which takes C with him).
C, . , iOS presentingViewController. , . , C, iOS B, C.
, B C C, A B C.
B, , , .