Ful*_*ron 6 cocoa-touch modal-dialog uiviewcontroller
在我的应用程序中,我可以在两种模式下调用UIViewControle:Push和ModalDialog.
一旦UIViewController处于活动状态,如何将其称为Push或Modal Dialog,我如何确定?
您可以modalViewController像这样检查父视图控制器的属性:
if ([self.parentViewController.modalViewController isEqual:self]) {
NSLog(@"Modal");
} else {
NSLog(@"Push");
}
Run Code Online (Sandbox Code Playgroud)
只需记住在推送/显示视图后检查它.
这对我有用:
if(self.presentingViewController){
//modal view controller
}else{
}
Run Code Online (Sandbox Code Playgroud)