我正在使我的应用程序在带有iOS 13的iPadOS上使用多个窗口,据我所知,由于它已被弃用,我无法直接访问窗口,我怎样才能获得最顶层的视图控制器?UIApplication
在iOS12之前我使用这个工作解决方案,你能建议一个替代方案吗?
+(UIViewController *)topMostViewController
{
UIViewController *vc = [[UIApplication sharedApplication].delegate.window rootViewController];
while(vc.presentedViewController)
{
vc = vc.presentedViewController;
}
return vc;
}