iOS UITextField value without tapping on RETURN button <p>Is it possible to take UITextField value without tapping <em>RETURN</em> button?. If I type something in <strong><em>LOGIN UITextField</em></strong> and then tap on <strong><em>PASSWORD UITextField</em></strong>, it looks like LOGIN value is empty, however if I type something in LOGIN, and then tap RETURN everything's fine.</p> <p>Without tapping on RETURN <a href="http://gyazo.com/2ca0f263275fd65ae674233f34d90280" rel="nofollow">http://gyazo.com/2ca0f263275fd65ae674233f34d90280</a></p> <p>With tapping on RETURN <a href="http://gyazo.com/9ccc39ba7080b6b6344454ec757d3c0f" rel="nofollow">http://gyazo.com/9ccc39ba7080b6b6344454ec757d3c0f</a></p> <p>Here's my code:</p> <p><strong>TextInputTableViewCell.m</strong></p> <pre><code>@implementation TextInputTableViewCell -(void)configureWithDictionary:(NSMutableDictionary *)dictionary { self.cellInfoDictionary = dictionary; NSString *title = [dictionary objectForKey:@"title"]; NSString *imageName = [dictionary objectForKey:@"imageName"]; UIColor *color = [dictionary objectForKey:@"bgColor"]; BOOL secureTextEntry = [dictionary objectForKey:@"secure"]; self.myTextField.placeholder = title; self.myImageView.image = [UIImage imageNamed:imageName]; self.contentView.backgroundColor = color; self.myTextField.secureTextEntry = secureTextEntry; self.myTextField.delegate = self; } -(BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; if (textField.text) { [self.cellInfoDictionary setObject:textField.text forKey:@"value"]; } return NO; } @end </code></pre> <p><strong>LoginViewController.m</strong></p> <pre><code>@interface LoginViewController () &lt;UITableViewDataSource, UITableViewDelegate, NewRestHandlerDelegate&gt; @property (strong, nonatomic) IBOutlet UITableView *tableView; @property (strong, nonatomic) NSArray *datasource; @end static NSString *textInputCellIdentifier = @"textInputCellIdentifier"; static NSString *buttonCellIdentifier = @"buttonCellIdentifier"; @implementation LoginViewController { NSString *email; NSString *password; NewRestHandler *restHandler; } - (void)viewDidLoad { [super viewDidLoad]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ([defaults boolForKey:@"logged"]) [self performSegueWithIdentifier:@"Logged" sender:self]; [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([TextInputTableViewCell class]) bundle:nil] forCellReuseIdentifier:textInputCellIdentifier]; [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([ButtonTableViewCell class]) bundle:nil] forCellReuseIdentifier:buttonCellIdentifier]; restHandler = [[NewRestHandler alloc] init]; restHandler.delegate = self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSDictionary *dictionary = [self.datasource objectAtIndex:indexPath.row]; NSString *cellIdentifier = [dictionary objectForKey:@"cellIdentifier"]; UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if ([cell respondsToSelector:@selector(configureWithDictionary:)]) { [cell performSelector:@selector(configureWithDictionary:) withObject:dictionary]; } return cell; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.datasource.count; } ... - (NSArray *)datasource { if (!_datasource) { NSMutableArray* datasource = [NSMutableArray arrayWithCapacity:5]; NSMutableDictionary* loginDictionary = @{@"cellIdentifier": textInputCellIdentifier, @"title": @"Login", @"imageName": @"edycja02.png", @"bgColor": [UIColor whiteColor], }.mutableCopy; NSMutableDictionary* passwordDictionary = @{@"cellIdentifier": textInputCellIdentifier, @"title": @"Password", @"imageName": @"edycja03.png", @"bgColor": [UIColor whiteColor], @"secure": @YES, }.mutableCopy; NSMutableDictionary* loginButtonDictionary = @{@"cellIdentifier": buttonCellIdentifier, @"title": @"Login", @"imageName": @"logowanie01.png", @"bgColor": [UIColor colorWithRed:88/255.0 green:88/255.0 blue:90/255.0 alpha:1], @"textColor": [UIColor whiteColor], }.mutableCopy; NSMutableDictionary* facebookLoginButtonDictionary = @{@"cellIdentifier": buttonCellIdentifier, @"title": @"Login with Facebook", @"imageName": @"logowanie02.png", @"bgColor": [UIColor colorWithRed:145/255.0 green:157/255.0 blue:190/255.0 alpha:1], @"textColor": [UIColor whiteColor], }.mutableCopy; NSMutableDictionary* signUpButtonDictionary = @{@"cellIdentifier": buttonCellIdentifier, @"title": @"Sign up", @"imageName": @"logowanie03.png", @"bgColor": [UIColor colorWithRed:209/255.0 green:210/255.0 blue:212/255.0 alpha:1], @"textColor": [UIColor whiteColor], }.mutableCopy; [datasource addObject:loginDictionary]; [datasource addObject:passwordDictionary]; [datasource addObject:loginButtonDictionary]; [datasource addObject:facebookLoginButtonDictionary]; [datasource addObject:signUpButtonDictionary]; _datasource = datasource; } return _datasource; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 2) { email = [self.datasource[0] valueForKey:@"value"]; password = [self.datasource[1] valueForKey:@"value"]; NSLog(@"Email: %@", email); NSLog(@"Password: %@", password); ... </code></pre>