Hi,
I would to enable the done button on the navbar (in a modal view) when the user write at least a char in a uitextfield. Using textFieldDidEndEditing: enables the button when the previous uitextfield resigns first responder (so with the zero chars in the current uitextfield). textFieldShouldBeginEditing: is called when the textfield becomes the first responder.
The solution could be
but neither
or
work.
Any ideas?
Thanks,
Fran
I would to enable the done button on the navbar (in a modal view) when the user write at least a char in a uitextfield. Using textFieldDidEndEditing: enables the button when the previous uitextfield resigns first responder (so with the zero chars in the current uitextfield). textFieldShouldBeginEditing: is called when the textfield becomes the first responder.
The solution could be
Code:
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
Code:
[self.navigationItem.rightBarButtonItem setEnabled:YES];
Code:
[doneButton setEnabled:YES]; //doneButton is an IBOutlet tied to my Done UIBarButtonItem in IB
Any ideas?
Thanks,
Fran