gpt4 book ai didi

cocoa-touch - 如何确定UIViewController是否已被称为ModalDialog?

转载 作者:行者123 更新时间:2023-12-04 02:56:21 25 4
gpt4 key购买 nike

在我的应用程序中,我可以在两种模式下调用UIViewControle:Push和ModalDialog。

一旦UIViewController处于 Activity 状态,如何确定是否称为“推送”或“模态对话框”?

最佳答案

您可以像这样检查父 View Controller 的modalViewController属性:

if ([self.parentViewController.modalViewController isEqual:self]) {
NSLog(@"Modal");
} else {
NSLog(@"Push");
}

只要记得在推/显示 View 后检查一下即可。

关于cocoa-touch - 如何确定UIViewController是否已被称为ModalDialog?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5252013/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com