ios - pch文件中包含这个文件什么用?响应不是系统的事吗?
PHPz
PHPz 2017-04-17 17:37:07
0
1
210
#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
PHPz
PHPz

学习是最好的投资!

membalas semua(1)
刘奇

Ini adalah kategori Ia boleh dilihat daripada kod bahawa fungsi kategori ini sepatutnya untuk mendapatkan objek pengawalnya melalui View, iaitu view.viewController

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan