- (UIViewController *)viewController;
- (UIViewController*)viewController {
for (UIView* next = [selfsuperview]; next; next = next.superview) {
UIResponder* nextResponder = [next nextResponder];
if ([nextResponderisKindOfClass:[UIViewController class]]) {
return (UIViewController*)nextResponder;
}
}
return nil;
}