danielamitay/DAKeyboardControl

removeKeyboardControl & addKeyboardPanningWithActionHandler issue

Closed this issue · 4 comments

When I add a subview to the view, I will call

[self.view removeKeyboardControl];

to remove the keyboard control, but the text field or text view is not dismiss yet. And I re-add

[self.view addKeyboardPanningWithActionHandler:^(CGRect keyboardFrameInView){}];

when I remove the subview from the view. But the drag down to dismiss keyboard is not working :(


In my case, when I added new subviews to the view, I wanted to removeKeyboardControl and add it back after I remove the subview. May I know is there any solutions on this? Thanks!

I am not sure if I exactly understand the scenario. Would you be able to provide an example project that demonstrates your scenario and issue?

Hi @danielamitay

Here are the extended project that I've created from your master file.

https://www.dropbox.com/s/uhsjmm5kno8ghbb/DAKeyboardControl-master-EXTENDED.zip

Brown Color Cell = Main Table View
when you type something, Yellow Color Cell will appears meaning got another table view on top of that.
and when you clear off the text field, Yellow Color Cell table view will remove from the view. And you try to pull down to dismiss it is not working, until you tap on the cell to resign the first responder then only it works on next time.

Hope this can clear your confusions @danielamitay :) thanks!

Hey, check out my latest commit.

Essentially, DAKeyboardControl makes the assumption that they keyboard is not yet active, and only sets up the pan gesture recognizer after receiving the keyboard's notification.

Now DAKeyboardControl will check if the keyboard is already active and setup appropriately.

Thanks @danielamitay, it works now 👍