模态

/模态:就是从一个页面中弹出一个临时的页面,用来收集用户信息,常用于登陆注册页面/

aViewController.m中调用bViewController.m的模态

aViewController.m/*/在 - (void)viewDidLoad
中用Button调用action方法-(void)action{ //1.用bViewController创建bViewController的对象bVC bViewController*bVC = [[bViewControlleralloc]init]; //2.用self 调用模态控制器方法 //animated:是否有动画 [selfpresentViewController:bVCanimated:YEScompletion:^{ //可以设置方法处理事件
}]; //3.设置模态样式 [bVCsetModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];

}/*/

bViewController.m /*/在 - (void)viewDidLoad
中用Button调用action方法-(void)action{
//用self 调用模态控制器方法
模态消失 [selfdismissViewControllerAnimated:YEScompletion:^{ //可以设置方法处理事件
}];}/*/

文章目录
|