//获取view的controller
- (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;
}
ios 获取当前view的controller,布布扣,bubuko.com
时间: 2024-10-12 16:30:53