通过在自定义单元格内进行修饰来制作基本的 animation/translation

Make a basic animation/translation by touch up inside a custom cell

我想将基本动画应用到我的自定义单元格中的某些元素,例如标签、图像:特别是我想在我在单元格内进行触摸时也启动这些动画。我是初学者,我只学会了使用 animateWithDuration 和 transitionByView: 可以用它们添加我的目标吗?

在您的自定义单元格中 class 覆盖 touchesEnded 事件并将动画放入其中

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesEnded:touches withEvent:event];

    [UIView animateWithDuration:1.0 animations:^{
        // your code
    }];
}

这将在您期望 touchUpInside 发生的同时触发