最終更新:2017-07-26 (水) 05:15:00 (2464d)  

UITextFieldDelegate textFieldShouldReturn:
Top / UITextFieldDelegate textFieldShouldReturn:

Asks the delegate if the text field should process the pressing of the return button.

- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
    if (theTextField == self.textField) {
        [theTextField resignFirstResponder];
    }
    return YES;
}

UITextFieldでリターンキーを押したときの動作

return YESのとき

  • されている
  • されていない

return NOのとき

  • なにもおきない

メモ

参考