Looking to understand the iOS UIViewController lifecycle

前端 未结 11 1943
情深已故
情深已故 2020-11-21 22:33

Could you explain me the correct manner to manage the UIViewController lifecycle?

In particular, I would like to know how to use Initialize

11条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 23:13

    Explaining State Transitions in the official doc: https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/index.html

    This image shows the valid state transitions between various view ‘will’ and ‘did’ callback methods

    Valid State Transitions:


    Taken from: https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Art/UIViewController Class Reference_2x.png

提交回复
热议问题