Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple depth for IQKeyboardManager's toolbarPreviousNextAllowedClasses #517

Closed
edopelawi opened this issue May 24, 2016 · 5 comments
Closed
Labels

Comments

@edopelawi
Copy link

Hi,

first of all, I'd like to thank you for this awesome library, it helped me a lot :)

I'm currently trying to register a custom UIView class with a UITextField inside it, lets call it CustomTextField. I wanted to make IQKeyboardManager's built-in next and previous button enabled for it, and found that I could do it by registering the class to toolbarPreviousNextAllowedClasses.

Problem is, CustomTextField is built using XIB, using the method from this link. This will make CustomTextField have one UIView subview, which will be loaded using UINib(nibName:, bundle:), and set the owner using returned nib's instantiateWithOwner(self, options: nil). I just realized that this method will make my UITextField become a subview of CustomTextField's subview, instead of become its direct subview.

Is there any workaround for this? Is it possible to enable the next and previous button for custom views made with method above?

Apologies if similar method has been asked before. Thank you very much!

@hackiftekhar
Copy link
Owner

In general, CustomTextView should be on top of all UITextField. Library will detect all textFields which are inside CustomTextView even if with multiple hierarchy.

@edopelawi
Copy link
Author

Hmm. Is it possible to assign that class to an UIView via XIB?

@edopelawi
Copy link
Author

Oops, seems I logged the wrong class. It works now :)

Still, I found it only sets the toolbar's next and before button... isn't it supposed to set the Next button as replacement of the Return button on the keyboard, too?

@hackiftekhar
Copy link
Owner

You should take a look at IQKeyboardReturnKeyHandler class to handle keyboard Return key.

@edopelawi
Copy link
Author

Cool, will look at that. Thanks man! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants