IOS: action with enter key of iPad KeyBoard

后端 未结 4 500
不思量自难忘°
不思量自难忘° 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:07

    Set your view controller to be the textfield's delegate then implement

    -(BOOL)textFieldShouldReturn:(UITextField *)textField
    

    this gets called when the enter button is pushed on the keyboard.

提交回复
热议问题