[email protected](nullable, nonatomic,readonly) UIViewController *presentedViewController和@property(nullable, nonatomic,readonly) UIViewController *presentingViewController :当我们在viewControllerA中模态显示viewControllerB的时候,A就充当presentingViewController,B就是presentedViewController。对于模态视图和普通视图最主要的区别就是模态视图显示的时候不能对其它视图进行操作
2.UIModalPresentationStyle(弹出风格):
typedefNS_ENUM(NSInteger, UIModalPresentationStyle) {
UIModalPresentationFullScreen = 0,
UIModalPresentationPageSheet,
UIModalPresentationFormSheet, 小于屏幕尺寸,居中显示
UIModalPresentationCurrentContext,
UIModalPresentationCustom,
UIModalPresentationOverFullScreen,
UIModalPresentationOverCurrentContext,
UIModalPresentationPopover,
UIModalPresentationNone,
}在iPad上有效,在iPhone和iPodtouch上系统始终以 UIModalPresentationFullScreen 显示presentedVC。
3.UIModalTransitionStyle 弹出时的动画风格
typedefNS_ENUM(NSInteger, UIModalTransitionStyle) {
UIModalTransitionStyleCoverVertical = 0, 从底部滑出
UIModalTransitionStyleFlipHorizontal, 水平翻转进入
UIModalTransitionStyleCrossDissolve, 交叉溶解
UIModalTransitionStylePartialCurl, 翻页
};
4,dismissViewController 消失弹出的VC
[controllerBdismissViewControllerAnimated:<#(BOOL)#> completion:<#^(void)completion#>]; presentVC调用从而取消presentedVC的显示
[controllerBdismissModalViewControllerAnimated:<#(BOOL)#>];(被划线了)将要废弃,不建议使用
5.视图加载流程
(1)创建视图控制器
<1>alloc init
<2>通过xib文件
OneVIewController *oneVC = [[OneVIewController alloc] initWithNibName:@"oneViewController" bundle:[NSBundle mainBundle]];
self.view.rootViewController = oneVC;
(2)页面加载顺序
<1>加载视图的命令执行的方向(通过断点法进行判断):APP -> APPDelegate -> 根视图控制器加载视图
<2>视图创建完成返回的APP方向(通过设置颜色法判断):有xib是有颜色的(自设)没有xib返回的一个View -> 根视图(ViewDidLoad)-> APP(application)
6.视图控制器的加载流程(图片源自网络)
7.根视图加载流程(图片源自网络)