Overload IPhone GO button to take action

I am developing an application using html and javascript. I have a login form with a login button. The text field accepts the username, and then clicks the login button, the login action occurs. However, now I want that when using the virtual keyboard in the iPhone, pressing the GO button should also trigger the login action. Please let me know the solution for the same. Thanks.

+4
source share
1 answer

Set a delegate object for the UITextField object (point to your view controller) and use the method

- (BOOL)textFieldShouldReturn:(UITextField *)textField 

-textFieldShouldReturn will be called immediately before the user who the user types β€œGo” or β€œReturn”. Remember to return YES.

+3
source

Source: https://habr.com/ru/post/1335219/


All Articles