찾다

 >  Q&A  >  본문

ios - pch文件中包含这个文件什么用?响应不是系统的事吗?

#import "UIView+UIViewController.h"

@implementation UIView (UIViewController)
-(UIViewController *)viewController{
    UIResponder *next = self.nextResponder;
    while(next !=nil){
        if([next isKindOfClass:[UIViewController class]]){
            return (UIViewController *)next;
        }
        next = next.nextResponder;
    }
    return nil;
}
@end
PHPzPHPz2888일 전215

모든 응답(1)나는 대답할 것이다

  • 怪我咯

    怪我咯2017-04-17 17:39:07

    이것은 카테고리입니다. 이 카테고리의 기능은 View, 즉 view.viewController를 통해 해당 컨트롤러의 객체를 가져오는 것이어야 함을 코드에서 볼 수 있습니다.

    회신하다
    0
  • 취소회신하다