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

Crash when lot of tap on view #58

Open DrewDe opened 10 years ago

DrewDe commented 10 years ago

Hi, I use DAKeyboardControl on a chat view controller and i noticed that when i do a lot of tap on the UItableView above the keyboard ( 5/6 tap ) my app crash.

I saw on Xcode the CPU of my iPhone is 100% used before the crash.

I have a crash on DAKeyboardControl.m ( ie: attached screenshot).

I use the code like this :

     __unsafe_unretained typeof(self) weakSelf = self;
    [self.view addKeyboardPanningWithActionHandler:^(CGRect keyboardFrameInView) {
        CGRect toolBarFrame = weakSelf->toolBar.frame;
        toolBarFrame.origin.y = keyboardFrameInView.origin.y - toolBarFrame.size.height ;
        if(weakSelf->keyboardShowing){
            weakSelf->toolBar.frame = toolBarFrame;
        }
        CGRect tableViewFrame = weakSelf->chatTableView.frame;
        tableViewFrame.size.height = toolBarFrame.origin.y - 68.0f;
        weakSelf->chatTableView.frame = tableViewFrame;
    }];

I would be grateful if you if you can help me.

Thanks, DrewDe

crash

hectorstudio commented 10 years ago

I have the same issue, in my case, it doesn't cause crash, but panning gesture doesn't work after that. Hope anyone cal help me on the issue.