Closed awgeorge closed 11 years ago
Damn, i did a search for UITableView Delete in bugs but failed to see the WIKI. Sorry.
I just implemented this function:
as noted in the issue linked on the WIKI page. And all is well.
Any reason you do not wish to add this to the source?
There's circumstances under which said implementation would cause even weirder behaviour :-)
On Apr 20, 2013, at 7:21 PM, awgeorge notifications@github.com wrote:
Damn, i did a search for UITableView Delete in bugs but failed to see the WIKI. Sorry.
I just implemented this function:
(BOOL)gestureRecognizer:(UIGestureRecognizer )gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer )otherGestureRecognizer as noted in the issue linked on the WIKI page. And all is well.
Any reason you do not wish to add this to the source?
— Reply to this email directly or view it on GitHub.
I completely agree, i experienced these very same issues with simply returning yes, however there is an alternative solution how about this:
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
if([otherGestureRecognizer.view isKindOfClass:[UITableView class]]){
//Are we a table view?
if([[(UITableView *)otherGestureRecognizer.view delegate] respondsToSelector:@selector(tableView:canEditRowAtIndexPath:)]){
//Has the UITableView enabled editing?
return YES;
}
}
return NO;
}
This checks if the tableview has editing enabled and if so does both actions. It works for me because i only have one panel so i can swipe to the left without both actions triggering.
Perhaps though we can disable the PKReveal panning action automatically if you are swiping a tableview with editing enabled?
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
if(touch.view.superview){
if([touch.view.superview isKindOfClass:[UITableViewCell class]]){
if([touch.view.superview.superview isKindOfClass:[UITableView class]]){
if([[(UITableView *)touch.view.superview.superview delegate] respondsToSelector:@selector(tableView:canEditRowAtIndexPath:)]){
return NO;
}
}
}
}
return YES;
}
This seems to fit the bill, however i can understand that it doesn't look pretty. But i am a novice at objective-c, perhaps a pro can improve this snippet. However the general idea is:
Let me know what you think.
Hello, any chance at looking into using "Swipe to Delete" on a UITableView with this control? At present it doesn't work with the TableView residing inside the frontPanel. This addition would be much appreciated.