In UIViewController’s documentation, Apple suggests calling the super at some point in the implementation of viewWillAppear, viewDidAppear, viewWillDisappear, viewDidDisappear, etc… For example, the discussion on viewDidDisappear is:
You can override this method to perform additional tasks associated
with dismissing or hiding the view. If you override this method, you
must call super at some point in your implementation.
My question is does it matter when the super method is called and, if so, what is the correct time to call it? Should super be called as the first line of the method, the last line, or somewhere in the middle depending on your particular needs?
In
viewDidAppearcallsuperfirst so that your calls will override.In
viewWillDisappearit seems to be a toss up, I have researched that extensively and could not find a conclusive answer and it seems to be 50/50. I have decided to callsuperlast in my code in the same manner we callsuperlast indealloc.