What I think, viewDidAppear is not called when adding or removing views. The reason for this is that there are several objects that we add / remove to the view as a subview. In this case, viewDidAppear will be called again and again, which is not a good mechanism. viewDidAppear is called when you load a class object into the current view and move the screen to another view of the class, and then return to the previous class. In short, if you click on the navigation controller on a new view, and then place it in an older view, then viewDidAppear is called.
source share