Skip to content

about resignFirstResponder

TheLittleBoy edited this page Apr 24, 2014 · 1 revision

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

  [self.view.subviews enumerateObjectsUsingBlock:^(UIView* obj, NSUInteger idx, BOOL *stop) {

        if ([obj isKindOfClass:[UITextField class]]) {

                [obj resignFirstResponder];

          }

   }];

}

you can do it like this:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

 [self.view endEditing:YES];

}

Clone this wiki locally