presentingViewController:
UIViewController *vc = [UIViewController new];
[self presentViewController:vc animated:YES completion:nil];
presentedViewController:
- (instancetype)init {
self = [super init];
if (self) {
self.modalPresentationStyle = UIModalPresentationCustom;//采用自定义呈现方式
self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;//采用从低往上动态覆盖的方式转场
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];//设置透明度
}
网友评论