Given the following view controller layout.
We build a stack of modal view controllers by first presenting B
on A
and then present
I am guessing that your segue from A to B is modal as well? In that case the dismiss
function called from A wants to dismiss the view, which is immediately on top of A, which is B. C just gets hidden in order to show you the animated hiding of B. In that sense you cannot stack views via modal segues and dismiss the top one with the dismiss
function as you described if you go that far back. The dismiss
would work as intended if called from B to dismiss C though.