模式对话窗体跳转
1、
//模式对话窗体跳转
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion; 如: SubViewController *svc = [[SubViewController alloc]init]; svc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentViewController:svc animated:YES completion:^{ }];
svc.modalTransitionStyle 指切换模式
2、
//关闭模式对话窗体
- (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion;
如:
[self dismissViewControllerAnimated:YES completion:^{
}];
生命周期
1、loadView
2、viewDidLoad
//3、viewDidUnload
//4、didReceiveMemoryWarning
5、viewWillAppear
6、viewDidAppear
7、viewWillDisappear
8、viewDidDisappear
一般生命周期是:loadView -> viewDidLoad -> viewWillAppear -> viewDidAppear ->viewWillDisappear ->viewDidDisappear