Search code examples
iphonekeyboard

Enable keyboard return key


I would like to enable the keyboard return key only when some uitextfields are not empty. I read this question How to disable/enable the return key in a UITextField?

Is this the only way? Is it true this could cause Apple to reject the app?


Solution

  • You can use the textFieldShouldReturn: method to prevent the return key from returning.

    http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html