模态化弹出:(视觉效果进入时:从下到上,出去时从上到下)
present和dismiss对应
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^ __nullable)(void))completion
- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion
GOVShareViewController *shareViewController = [[GOVShareViewController alloc] initWithArticle:article];
[self presentViewController:shareViewController animated:NO completion:^(void){
[shareViewController presented];
}];
[self dismissViewControllerAnimated:YES completion:nil];
推入:(视觉效果是从右向左滑入,出去时从左到右)
pop 和push对应 (根视图是NavigationController,不然是不可以用的)
[self.navigationController popViewControllerAnimated:NO];
[self.navigationController pushViewController:pushController animated:animationPush];
用viewController的属性presentingViewController判断是不是模态化弹出
if (self.presentingViewController ! = nil ){
@"我是模态化弹出";
}