Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个从两个不同的 UIViewController A 和 B 呈现的 modalView。我想要做的是检测 modalView 来自 A 或 B,并执行一些不同的操作。
我想我可以使用委托或其他标志来检测它,但有更好的方法吗?
提前致谢。
UIViewController.presentingViewController当您显示模态 VC 时,您可能希望使用UIViewController presentViewController:animated:completion.
UIViewController.presentingViewController
UIViewController presentViewController:animated:completion