iOS 生命周期详解

2020-01-13  本文已影响0人  多肉肉

iOS生命周期调动系统函数过程:

有Storyboard

[ViewController load]

[ViewController initWithCoder:]

[ViewController awakeFromNib]

[ViewController loadView]

[ViewController viewDidLoad]

[ViewController viewWillAppear:]

[ViewController viewWillLayoutSubviews]

[ViewController viewDidLayoutSubviews]

[ViewController viewDidAppear:]

无storyboard

[ViewController load]

[ViewController initWithNibName:bundle:]

[ViewController init]

[ViewController loadView]

[ViewController viewDidLoad]

[ViewController viewWillAppear:]

[ViewController viewWillLayoutSubviews]

[ViewController viewDidLayoutSubviews]

[ViewController viewDidAppear:]

举例子:AViewController push到 BViewController:

上一篇下一篇

猜你喜欢

热点阅读