presentingViewController:
UIViewController *vc = [UIViewController new];
[self presentViewController:vc animated:YES completion:nil];
presentedViewController:
- (instancetype)init {
self = [super init];
if (self) {
self.modalPresentationStyle = UIModalPresentationCustom;//采用自定義呈現(xiàn)方式
self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;//采用從低往上動(dòng)態(tài)覆蓋的方式轉(zhuǎn)場
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];//設(shè)置透明度
}