我在StackOverflow上看到了其他问题并完成了以下操作:
UISwipeGestureRecognizer *swipeGestureLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(viewDidSwipeLeft:)]; swipeGestureLeft.delegate = self; [swipeGestureLeft setDirection:UISwipeGestureRecognizerDirectionLeft]; [self.mainView addGestureRecognizer:swipeGestureLeft]; UISwipeGestureRecognizer *swipeGestureRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(viewDidSwipeRight:)]; swipeGestureRight.delegate = self; [swipeGestureLeft setDirection:UISwipeGestureRecognizerDirectionRight]; [self.mainView addGestureRecognizer:swipeGestureRight];
我没有viewDidSwipeLeft
:来电
我也在tableView类中添加了它..
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleNone;
}