iOS中ViewController切换时的调用顺序

一个tabbarController,里面有1,2 两个ViewController,当从1切换到2时,执行的顺序是

2 viewWillAppear
1 viewWillDisappear
1 viewDidDisappear
2 viewDidAppear

2->1:

1 viewWillAppear
2 viewWillDisappear
2 viewDidDisappear
1 viewDidAppear

navController中,1进入2

1 viewWillDisappear
2 viewWillAppear
1 viewDidDisappear // 已经几乎完全显示后显示了2的画面之后(有些背景等可能还没加载)
2 viewDidAppear

2返回1:

2 viewWillDisappear
1 viewWillAppear
2 viewDidDisappear
1 viewDidAppear

modol窗口

1 viewWillDisappear
2 viewWillAppear
2 viewDidAppear
1 viewDidDisappear

2->1

2 viewWillDisappear
1 viewWillAppear
1 viewDidAppear
2 viewDidDisappear

iOS中ViewController切换时的调用顺序》有6个想法

发表回复

电子邮件地址不会被公开。 必填项已用*标注