Skip to content

Multiple depth for IQKeyboardManager's toolbarPreviousNextAllowedClasses #517

Closed

Description

@edopelawi

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!

Activity

  1. hackiftekhar commented on May 24, 2016

    @hackiftekhar
    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.

  2. edopelawi commented on May 27, 2016

    @edopelawi
    Author

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

  3. edopelawi commented on May 27, 2016

    @edopelawi
    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?

  4. hackiftekhar commented on May 27, 2016

    @hackiftekhar
    Owner

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

  5. edopelawi commented on May 30, 2016

    @edopelawi
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions