문제

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.

도움이 되었습니까?

해결책

You can handle UITextFieldDelegate:

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

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

    return YES;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top