IOS: action with enter key of iPad KeyBoard

后端 未结 4 501
不思量自难忘°
不思量自难忘° 2021-02-06 22:36

I have two textfield, in first textfield I write \"Hello\" and when I push enter in iPad keyboard, I want that in second textfield appear \"World\"; How can I use enter to creat

4条回答
  •  一整个雨季
    2021-02-06 23:12

    You would typically assign your view controller as the text field's delegate and then implement the textFieldShouldReturn: method, e.g.:

    - (BOOL)textFieldShouldReturn:(UITextField *)textField {
        otherTextField.text = @"World"
        return YES;
    }
    

提交回复
热议问题