kulpreetchilana / Custom-iOS-Keyboards

Easily customizable custom inputView for iOS that imitates the native iOS keyboard.
474 stars 119 forks source link

Fix for the Return key when using the custom keyboards with UITextFields... #11

Closed vanderneut closed 9 years ago

vanderneut commented 9 years ago

.... In that case, the return key should trigger the textFieldShouldReturn: delegate method. -- Erik

vanderneut commented 9 years ago

Hi Kulpreet,

See my commit notes on this pull request. Let me know if you have any questions. I have verified this fix in my application.

Thanks, Erik

vanderneut commented 9 years ago

Kulpreet,

To explain my motivation for this code change: when using a UITextField with a standard keyboard in iOS, then hitting the Return key will result in a call to the textFieldShouldReturn: delegate method. Your custom keyboard was not doing that. It was inserting a newline character in the text field string instead. That is correct behavior for a multiline UITextView, but not for the UITextField. This is a fix for that.

For more information, see https://developer.apple.com/library/ios/documentation/uikit/reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html

Thanks, Erik

kulpreetchilana commented 9 years ago

Thanks Erik! I merged in all of your changes.