UIViewControler视图加载流程

导航进去CustomViewController
展示
// push进去之前
-[UINavigationController pushViewController:animated:]
-[UINavigationController pushViewController:transition:forceImmediate:]
-[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:]
-[customVC willMoveToParentViewController:]
//push进去之后
-[CALayer layoutSublayers]
-[UIView(CALayerDelegate) layoutSublayersOfLayer:]
-[UILayoutContainerView layoutSubviews]
-[UINavigationController __viewWillLayoutSubviews]
-[UINavigationController _startDeferredTransitionIfNeeded:]
[UINavigationController _startCustomTransition:]
-[ViewController view]
-[UIViewController loadViewIfRequired]
-[ViewController loadView];
-[customVC viewDidLoad];

-[UIViewController viewWillMoveToWindow:]
-[ViewController viewWillAppear:]

-[CALayer layoutSublayers]
-[UIView(CALayerDelegate) layoutSublayersOfLayer:]
-[ViewController viewWillLayoutSubviews]

-[UIViewAnimationState animationDidStop:finished:]
-[UIViewAnimationState sendDelegateAnimationDidStop:finished:]
-[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:]-[_UINavigationParallaxTransition animateTransition:]
-[_UIViewControllerTransitionContext completeTransition:]
-[UINavigationController _startCustomTransition:]
-[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:]
-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]
-[ViewController viewDidAppear:]
-[UINavigationController viewDidAppear:]

-[ViewController didMoveToParentViewController:]

消失 在customVC执行viewWillAppear之后调用前一个控制器的
-[UINavigationBar popNavigationItemAnimated:]
-[UINavigationBar _popNavigationItemWithTransition:]
-[UINavigationController navigationBar:shouldPopItem:]
-[UINavigationController popViewControllerAnimated:]
-[UINavigationController _popViewControllerWithTransition:allowPoppingLast:]
-[customVC willMoveToParentViewController:]

-[UINavigationController _startDeferredTransitionIfNeeded:]
-[UINavigationController _startCustomTransition:]
-[ViewController viewWillDisappear:]

-[UIViewAnimationState animationDidStop:finished:]
-[UIViewAnimationState sendDelegateAnimationDidStop:finished:]
-[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:]-[_UINavigationParallaxTransition animateTransition:]
-[_UIViewControllerTransitionContext completeTransition:]
-[UINavigationController _startCustomTransition:]
-[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:]
-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]

  • (void)viewDidDisappear:(BOOL)animated

  • (void)didMoveToParentViewController:(UIViewController *)parent

测试方法 打断点 bt查看函数调用栈

你可能感兴趣的:(UIViewControler视图加载流程)