danielamitay / DAKeyboardControl

DAKeyboardControl adds keyboard awareness and scrolling dismissal (ala iMessages app) to any view with only 1 line of code.
Other
1.58k stars 214 forks source link

removeKeyboardControl & addKeyboardPanningWithActionHandler issue #56

Closed keithyeohh closed 10 years ago

keithyeohh commented 10 years ago

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!

danielamitay commented 10 years ago

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?

keithyeohh commented 10 years ago

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!

danielamitay commented 10 years ago

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.

keithyeohh commented 10 years ago

Thanks @danielamitay, it works now :+1: