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

toolbarPreviousNextAllowedClasses didn't add arrow #537

Closed
codwam opened this issue Jun 19, 2016 · 1 comment
Closed

toolbarPreviousNextAllowedClasses didn't add arrow #537

codwam opened this issue Jun 19, 2016 · 1 comment
Labels

Comments

@codwam
Copy link

codwam commented Jun 19, 2016

My code:
let keyboardManager = IQKeyboardManager.sharedManager()
// This has effect, but is depredated
keyboardManager.considerToolbarPreviousNextInViewClass(CardsInfoView.classForCoder())
// Can't add arrow in inner textField
keyboardManager.toolbarPreviousNextAllowedClasses = Set(arrayLiteral: String(CardsInfoView))
keyboardManager.shouldResignOnTouchOutside = true
keyboardManager.enable = true

Your code:
/** Get all UITextField/UITextView siblings of textFieldView. */
private func responderViews()-> [UIView]? {

    var superConsideredView : UIView?

    //If find any consider responderView in it's upper hierarchy then will get deepResponderView.
    for disabledClassString in toolbarPreviousNextAllowedClasses {

        if let disabledClass = NSClassFromString(disabledClassString) {

"NSClassFromString" In apple doc:
Obtains a class by name.
The class object named by aClassName, or nil if no class by that name is currently loaded. If aClassName is nil, returns nil.

And I see disabledClass is always nil cause SpecialView is currently loaded?

@codwam
Copy link
Author

codwam commented Jun 19, 2016

Sorry, I have found the reason.

// This can't find the class in swift...
keyboardManager.toolbarPreviousNextAllowedClasses = Set(arrayLiteral: String(CardsInfoView))

// <# ProjectName #>.<# View.classname #> is the right way to load in swift...
keyboardManager.toolbarPreviousNextAllowedClasses = Set(arrayLiteral: NSStringFromClass(CardsInfoView.classForCoder()))

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