//获取view所在的ViewController - (UIViewController )viewController { for (UIView next = [self superview]; next; next = next.superview) { UIResponder *nextResponder = [next nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]]) { return (UIViewController *)nextResponder; } } return nil; }
获取view所在的viewController
最新推荐文章于 2020-12-24 13:54:18 发布