iOS--viewDidAppear和viewDidDisappear调用顺序

5A9860526261D7F87DF58E250740A005.jpg

测试结果:

与跳转方式(push/present)有关:

  self.navigationController?.pushViewController(vc, animated: true)
----ViewController---viewDidDisappear-------
---ViewController2----viewDidAppear-------

self.present(vc, animated: true, completion: nil)
---ViewController2----viewDidAppear-------
----ViewController---viewDidDisappear-------
只跟跳转方式有关,与动画无关

推荐阅读更多精彩内容