I am making a browser type app..
Now i have made the Url entering textfield...which shows up the keyboard..
Now i have made it be Url type keyboard..it has Go button and for iPad a button to hide the keyboard..
-(BOOL)textFieldShouldReturn:(UITextField *)textField
i know above is the method that is called when user clicks return on Keyboard..
but for iPad ..there are two different things..i want to go the new URL if user presses Go..and leave the window as it is if user presses hide keyboard..but the problem is both the events report
-(BOOL)textFieldShouldReturn:(UITextField *)textField
so how do i differentiate user pressed Go ..or just hide keyboard..
When the user taps Hide button, the UIKeyboardWillHideNotification gets called,so you should register for observing it
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHideHandler:)
name:UIKeyboardWillHideNotification
object:nil];
- (void) keyboardWillHideHandler:(NSNotification *)notification {
//show another viewcontroller here
}
Apparently now it seems that the Go button only reports
-(BOOL)textFieldShouldReturn:(UITextField *)textField
and hide keyboard button doesn't..
I am pretty sure yesterday this was not the case..but anyways..i believe i am only to blame for this mess up..i will leave the question open if anyone needs clearing.
You try to use touch function with key board I think it will work.
At least on iOS 12 textFieldDidEndEditing(_:) is called when tapping the hide button (on iPad).
Hope this helps.