hackiftekhar/IQKeyboardManager

How to handle the return button

mdarveau opened this issue · 8 comments

Hi,

The previous/next/done buttons in the toolbar works perfectly. However, there is still the return button on the bottom right corner that does not do anything useful. I would like it to behave just like the next button for most fields. I can implement textFieldShouldReturn to handle the return button but I will have to rewrite the logic to move to the next text field. Could you expose something like moveNext in the IQKeyboardManager (basically exposing IQKeyboardManager.nextAction).

Thanks!

Hi MacKeeper,
Just released v3.1.0 with Return Key support. Now you can use 'IQKeyboardReturnKeyHandler' to use keyboard Return Key as Next without any manual effort. For details please read 'Keyboard Return Key Handling' section on documentation here:-
https://github.com/hackiftekhar/IQKeyboardManager

Thanks
Iftekhar

Wow, thanks a lot!

nakp commented

Hi,

I'm kinda still wondering how to do something with last field when it's return key is hit, as I use this to send something after hitting Go or Join.

Maybe event listeners would do the work? just like the ones attached to prev/next done keys

Hi ,It doesn't work if UITextfield in a TableView.

Added delegate method callbacks for doing something when hitting Go or Join

@hackiftekhar
any ideas how to implement any action on the last textfield when the user taps the Done or the Go or Join button?
thanks

You can set the delegate if IQReturnKeyHandler to self, implement delegate methods in self. You'll get all delegate callbacks of UITextField and UITextView on self.

Then you can whatever you want by checking textfield object

@hackiftekhar thanks for the clarification