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

IQKeyboardManager interaction with UIKeyInput Protocol? #949

Open
cody1024d opened this issue Aug 30, 2017 · 6 comments
Open

IQKeyboardManager interaction with UIKeyInput Protocol? #949

cody1024d opened this issue Aug 30, 2017 · 6 comments

Comments

@cody1024d
Copy link

I'm looking to implement a custom UIView that will open the keyboard, and respond to the input (in my case, it's going to be a pin-entry view).

Was just curious if IQKeyboardManager interacts with this protocol in anyway? I seemingly cannot get the UIKeyInput protocol to function as the documentation says it does.

@hackiftekhar
Copy link
Owner

Because your custom view doesn't trigger didBeginEditing, didEngEditing callbacks. and library depends on those notifications.

@cody1024d
Copy link
Author

cody1024d commented Aug 31, 2017

@hackiftekhar Is there some way I can trigger these call backs manually? Could I just send something through the notification center, or something?

Or would it be better to perhaps disable IQKeyboardManager for the specific view controller that has the custom view? And manage the keyboard manually, and then turn it back on after?

@cody1024d
Copy link
Author

@hackiftekhar I have created a demo project, that actually has UIKeyInput working with a very simple view. It must be something else within my application causing these issues. Closing this issue.

@Goallying
Copy link

I customed a UIView which apply to ,can this view work with IQKeyboardManager ?

@damirstuhec
Copy link

@cody1024d would you happen to remember how did you achieve that in your demo project? I'm looking at the same thing.

@ov1d1u
Copy link

ov1d1u commented May 17, 2024

@hackiftekhar Is there some way I can trigger these call backs manually? Could I just send something through the notification center, or something?

For any lost souls wandering for an answer to this, you have to post UITextView.textDidBeginEditingNotification and UITextView.textDidEndEditingNotification using NotificationCenter with your custom view as the object. Something like:

    override func becomeFirstResponder() -> Bool {
        NotificationCenter.default.post(
            Notification(name: UITextView.textDidBeginEditingNotification, object: self)
        )
        
        return super.becomeFirstResponder()
    }

@hackiftekhar hackiftekhar reopened this Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants