gpt4 book ai didi

ios - "AnyDo"滑动删除动画

转载 作者:行者123 更新时间:2023-12-01 17:42:29 25 4
gpt4 key购买 nike

Any do swipe to delete animation

我正在尝试像在 AnyDo 应用程序中一样在滑动时实现表格 View 单元格删除。任何帮助???

我的代码:

我正在使用手势识别器

      - (UISwipeGestureRecognizer *)swipeRightRecognizer 
{
if (!_swipeRightRecognizer)
{
_swipeRightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
_swipeRightRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
}

return _swipeRightRecognizer;
}

向单元格添加手势:
       [cell.contentView addGestureRecognizer:self.leftGestureRecognizer];

处理滑动。
       - (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer indexPath: (NSIndexPath *)index
{
if (recognizer.direction == UISwipeGestureRecognizerDirectionLeft)
{
//Table View deletion code. + Line to be drawn on cell, move that cell to the bottom of the table with animaiton.
}

}

最佳答案

Colin Eberhardt 在 How to Make a Gesture-Driven To-Do List App Like Clear 上写了一篇很棒的教程.还实现了滑动删除功能。

关于ios - "AnyDo"滑动删除动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15022356/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com