I have a UIPanGuestureRecognizer added to the whole view using this code:
UIPanGestureRecognizer *pgr = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)]; [[self view] addGestureRecognizer:pgr];
In the main view, I have a UITableView that has this code to enable the swipe removal function:
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"RUNNING2"); return UITableViewCellEditingStyleDelete; } - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row >= _firstEditableCell && _firstEditableCell != -1) NSLog(@"RUNNING1"); return YES; else return NO; }
Only RUNNING1 is printed in the RUNNING1 , and the Delete button is not displayed. I believe the reason for this is UIPanGestureRecognizer, but I'm not sure. If this is correct, how should I fix it. If this is not the case, indicate the cause and repair. Thank you
ios objective-c uitableview uipangesturerecognizer
carloabelli
source share