Is there a built-in way (rather than using my own flags) to differentiate when viewDidAppear
is called because the view controller was pushed to the navigation stack, rather than when a modal disappears?
In other words, I need to execute code when the view appears only when it is pushed to the navigation stack. When I perform the action I'm presenting a view controller and dismissing it automatically. Upon dismissing it, the viewDidAppear
gets called again, entering in an infinite loop.
How can I avoid this infinite loop?
This question is related to a modal viewController
and not regarding coming from and to the viewController
through navigation.