In my iOS application, on "More Information Screen" I have 10-12 UITextField
to get user information.
User needs to type all information except "State".
When user clicks on "State" UITextField >> New UITableViewController
is pushed.
Everything works fine, but when user clicks on "State" field "Keyboard
" should get dismissed which is opened due to other fields like "City", "Address".
For this I have added "Tag = 1
" to "State" UITextfield
, When user clicks on "State" field keyboard should get dismissed and new view should get loaded.
I have added following code but no luck:
- (void)textFieldDidBeginEditing:(UITextField *)textField{
if(textField.tag == 1){
[txtCity resignFirstResponder];
[textField resignFirstResponder];
[self.view endEditing:YES];
//load state listing
SelectStateProvince *selectStateProvince = [[SelectStateProvince alloc] initWithStyle:UITableViewStyleGrouped];
selectStateProvince.parentViewName = @"Respondent";
[self.navigationController pushViewController:selectStateProvince animated:YES];
}
}
Am I missing something? Please suggest.
Thank you.