Center TableView Controller not responding to didDeselectRowAtIndexPath
Hi There,
For ios_[redacted], i've noticed some problems with MMDrawerController. I have left and right sides of the controller containing tableviews. Their responses to didDeselectRowAtIndexPath work perfectly.
However, when i have a tableViewController set as my centerview as well, I have problems responding to didDeselectRowAtIndexPath for my controllers. And on occasion, some uibuttonbaritems dont respond either.
What happens is the tableViewCell stays highlighted, and never deselcts. The didDeselectRowAtIndexPath never gets called. If i select another cell while i have the weird cell selection on another cell already, my app crashes with
2013-08-19 08:56:56.173 Dump Chat[98960:a0b] *** Assertion failure in -[UITableView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2891.1/UIView.m:8536
This only started happening in Beta 3 of ios_[redacted]. I'm not sure where the problem lays though. Has anyone encountered this, and have a fix?
Thanks
I have not seen that problem myself. I am maintaining a ios_redacted branch here and the example project works fine, so feel free to look at that.
I would imagine this is a problem in your specific hierarchy, not the drawer controller, but feel free to open this back up if you find some evidence suggesting it is.
Just wanted to follow up with this. I found my problem(s).
The first problem with regards to the assertion failure was due to me using Auto Layout with a UITableViewServerHeaderFooterView. Apparently that's bad JuJu in ios.
And secondly, the reason why the taps were not being recognized was because I was returning YES almost always in
[controller setGestureShouldRecognizeTouchBlock:^BOOL(MMDrawerController *drawerController, UIGestureRecognizer *gesture, UITouch *touch) {...}];
Thus it seemed like the Tap was always trying to open in the center view. And because of this, the tableview wouldn't register the taps on the cells.
The logic inside the method above was definitely wrong. But if YES is always returned in the above method, would you expect the touches in the tableview to be ignored?
Yes I would expect that, since the gesture is applied to the super view of the table view, meaning it intercepts the touches and never passes it through.
Okay that's great to know. It was just my understanding that was wrong that's all. Thank you the explanation!