I have an UITextView and if the user touches it, an accessory view will be added to the keyboard, so that the user can hide the keyboard again.
I now added an UITextField and was wondering how to add the same accessory view to the keyboard once it pops upon for the UITextField. Is there an equivalent for the following code for UITextfield? textFieldShouldBeginEditing does not exist…
- (BOOL)textViewShouldBeginEditing:(UITextView *)aTextView {
if (aTextView.inputAccessoryView == nil) {
aTextView.inputAccessoryView = accessoryView;
self.accessoryView = nil; // After setting the accessory view for the text view, we no longer need a reference to the accessory view
}
return YES;
}
There is the UITextFieldDelegate protocol in which you can find the method
Have been looking for that one?