键盘消失

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

- (void)viewDidLoad {
    [super viewDidLoad];
    UITapGestureRecognizer *mullTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hiddenKeyBoard)];
    mullTap.delegate = self;
    mullTap.numberOfTapsRequired = 1;
    [self.view addGestureRecognizer:mullTap];

}

-(void)hiddenKeyBoard
{
    [self.view endEditing:YES];
}