轉(zhuǎn)場的方法
- push方法轉(zhuǎn)場
- modal方法轉(zhuǎn)場
- 自定義轉(zhuǎn)場
//push方法轉(zhuǎn)場
[self.navigationController pushViewController:[ZCResultViewController new] animated:YES];//push
[self.navigationController popViewControllerAnimated:YES];//返回
//modal方法轉(zhuǎn)場
[self presentViewController:[ZCResultViewController new] animated:YES completion:nil];//present
[self dismissViewControllerAnimated:YES completion:nil];//返回
UIViewController狀態(tài)
- (void)loadView {
[super loadView];
}
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidDisappear:animated];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
注意 : (loadView方法) If you use Interface Builder to create your views and initialize the view controller, you must not override this method.
轉(zhuǎn)場過程對狀態(tài)的影響
- 從firstVC轉(zhuǎn)場到resultVC的過程揽涮,依次調(diào)用
- viewWillDisappear(firstVC)
- viewWillAppear (resultVC)
- viewDidDisappear (firstVC)
- viewDidAppear (resultVC)
- 從resultVC轉(zhuǎn)場到firstVC的過程葛闷,依次調(diào)用
- viewWillDisappear(resultVC)
- viewWillAppear (firstVC)
- viewDidDisappear (resultVC)
- viewDidAppear (firstVC)
說明 : Disappear(Appear)過程無轉(zhuǎn)場動畫的情況下的妖,Will和Did方法之間幾乎是同時調(diào)用磕潮。在有轉(zhuǎn)場動畫的情況下蝗敢,Will和Did方法的調(diào)用時間相差0.6秒左右