Like seriously after going through this...
... I have multiple TextFields
and a few TextViews
. Is there not a way to a have a batch or group Dismiss First Responder for all text fields? Will I need to make method for each field? Maybe I overlooked something in that link?
Maybe I can follow something like this:
Would the latter make sense? Thanks in advance.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I figured it out....
Controller.h
@interface Controller : UIViewController <UITextFieldDelegate> {
IBOutlet UITextField *clickedDone;
}
@property (nonatomic, retain) IBOutlet UITextField *clickedDone;
Controller.m
#import "Controller.h"
@implementation Controller
@synthesize clickedDone;
- (void)viewDidLoad
{
[super viewDidLoad];
[clickedDone setDelegate:self];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
The view has an
endEditing:
method you can use. The docs sayIn your view controller you can just call:
Best answer is:
Its very easy now. You can follow different approach depending on your use cases. In my case I had multiple textfields in UITableViewController. What I did is this :