push和present推出新页面的生命周期顺序

以下为push和modal两种情况由①推出②时,两个页面中视图生命周期方法的执行顺序

push

14:06:22.750 ①viewWillDisappear:
14:06:22.751 ②loadView
14:06:22.752 ②viewDidLoad
14:06:22.752 ②viewWillAppear:
14:06:23.333 ①viewDidDisappear:
14:06:23.334 ②viewDidAppear:

pop

14:06:24.418 ②viewWillDisappear:
14:06:24.418 ①viewWillAppear:
14:06:24.993 ②viewDidDisappear:
14:06:24.993 ①viewDidAppear:

present

14:06:27.800 ②loadView
14:06:27.801 ②viewDidLoad
14:06:27.803 ①viewWillDisappear:
14:06:27.803 ②viewWillAppear:
14:06:28.345 ②viewDidAppear:
14:06:28.346 ①viewDidDisappear:

dismiss

14:06:29.223 ②viewWillDisappear:
14:06:29.223 ①viewWillAppear:
14:06:29.801 ①viewDidAppear:
14:06:29.801 ②viewDidDisappear:

你可能感兴趣的:(push和present推出新页面的生命周期顺序)