iOS自定义UITableView单元格按钮

iOS自定义UITableView单元格按钮,ios,uitableview,uibutton,swipe,Ios,Uitableview,Uibutton,Swipe,我希望当用户滑动表视图单元格时,显示多个编辑按钮(默认为删除按钮)。是否可以在tableView:tableView editingStyleForRowAtIndexPath:方法中放置自定义按钮?将手势识别器添加到类中,并在其选择器中尝试以下操作 -(void)cellDidSwipeLeft:(UIGestureRecognizer *)_gestureRecognizer { if(_gestureRecognizer.state == UIGestureRecognizerS

我希望当用户滑动表视图单元格时,显示多个编辑按钮(默认为删除按钮)。是否可以在
tableView:tableView editingStyleForRowAtIndexPath:
方法中放置自定义按钮?

将手势识别器添加到类中,并在其选择器中尝试以下操作

-(void)cellDidSwipeLeft:(UIGestureRecognizer *)_gestureRecognizer
{
     if(_gestureRecognizer.state == UIGestureRecognizerStateEnded)
     {
         CGPoint swipeLocation = [_gestureRecognizer locationInView:self.tableView];

            NSIndexPath *swipedIndexPath = [self.tableView indexPathForRowAtPoint:swipeLocation];


            UITableViewCell* swipedCell = (UITableViewCell *)[self.tableView cellForRowAtIndexPath:swipedIndexPath];
            YourCustomBtn *Btn = (YourCustomBtn *)[swipedCell viewWithTag:999];

            [self performAnimationOnObject:Btn forPoint:swipeLocation];
      }
}





-(void)performAnimationOnObject:(id)view forPoint:(CGPoint)point
    {
     CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
        animation.delegate = self;
        animation.fromValue = [NSValue valueWithCGPoint:CGPointMake(btn.superview.frame.size.width, btn.center.y)];
                animation.toValue = [NSValue
                                     valueWithCGPoint:CGPointMake(mainCleanFrame.origin.x, btn.center.y)];
                animation.fillMode = kCAFillModeForwards;
                btn.center = CGPointMake(btn.frame.origin.x, btn.center.y);
    }

我创建了一个新的库来实现可切换按钮,它支持各种转换和可扩展按钮,如iOS 8邮件应用程序

此库与创建UITableViewCell及其在iOS 5、iOS 6、iOS 7和iOS 8上测试的所有不同方式兼容


你能不能帮我看看怎么做?!您可以在中以编程方式而不是EditingStyle创建按钮我知道,但我希望它以本机样式显示,就像“删除”按钮显示一样。我知道我可以使用滑动手势识别器。