iOS 获取当前控制器ViewController
2017-05-18 本文已影响19人
Bager
+ (UIViewController *)getPresentVC
{
UIViewController *appRootVC = [UIApplication sharedApplication].keyWindow.rootViewController;
UIViewController *topVC = appRootVC;
if (topVC.presentedViewController)
{
topVC = topVC.presentedViewController;
}
return topVC;
}