When do you call the super method in viewWillAppear, viewDidDisappear, etc…?

前端 未结 3 1213
我在风中等你
我在风中等你 2021-01-12 01:57

In UIViewController\'s documentation, Apple suggests calling the super at some point in the implementation of viewWillAppear, viewDidAppear, viewWillDisappear, viewDidDisapp

3条回答
  •  天涯浪人
    2021-01-12 02:25

    In viewDidAppear call super first so that your calls will override.

    In viewWillDisappear it 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 call super last in my code in the same manner we call super last in dealloc.

提交回复
热议问题