Suppose I have a controller controller stack with two view controllers: VC2 is on top, and VC1 is on the bottom. Is there any code that I can include in VC1 that detects that VC2 has just popped off the stack?
Since I'm trying to detect a VC2 popup from code for VC1, it seems like something like viewWillAppear or viewDidAppear will not work, because these methods every time VC1 is displayed, including when it is first pushed onto the stack.
EDIT: It seems to me that I did not quite understand my original question. Here's what I'm trying to do: determine when VC1 is displayed due to VC2 slipping out of the top of the stack. Here's what I am NOT trying to do: determine when VC1 is displayed due to being inserted at the top of the stack. I need a way that will detect the first action, but NOT the second action.
Note. I donβt really care about VC2, it can be any number of other VCs that exit the stack, which worries me when VC1 again becomes the top of the stack due to the fact that some other VC starts popping up from above.
stack ios uinavigationcontroller
JMLdev Sep 12 2018-12-12T00: 00Z
source share