标签:
1. UIResponder
UIViewController *uvc; UIResponder* nextResponder = [self.superview.superview.superview nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]]) { uvc = (UIViewController*)nextResponder; }
2.获取当前屏幕中present出来的viewcontroller
- (UIViewController *)getPresentedViewController { UIViewController *appRootVC = [UIApplication sharedApplication].keyWindow.rootViewController; UIViewController *topVC = appRootVC; if (topVC.presentedViewController) { topVC = topVC.presentedViewController; } return topVC; }
标签:
原文地址:http://www.cnblogs.com/SimonGao/p/5063944.html