Question

fairly new to iOS programming. I want to be able to submit a form with the return key after the password has been entered. Right now i have a username and password text field. Once the client enters the password I want the enter key to be able to submit the form. I have a submit button to allow signing in, but I also want the return key to do the task as well. Any help would be great! This is for iOS, object-c programming.

Was it helpful?

Solution

You can handle UITextFieldDelegate:

- (BOOL)textFieldShouldReturn:(UITextField *)textField {

    if (textField == ...your password field...) {
        //Your submit code goes here
        return NO;
    }

    return YES;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top