SWReveal - CoreAnimation警告:刚度/阻尼必须大于0

时间:2015-10-28 11:45:11

标签: swift swrevealviewcontroller

在单独的项目中运行测试后,我已将SWReveal集成到我的应用程序中。

我从here下载了SWReveal(latest = v2.4),并按照AppCoda上的教程。

在独立项目中我没有任何问题。但是在我的应用程序内部(仍然作为一组独立的视图控制器/表运行,我收到这两个警告:

CoreAnimation: stiffness must be greater than 0.
CoreAnimation: damping must be greater than or equal to 0.

如果我禁用滚动的所有方面或启用所有方面,警告就会消失。这与我从AppCoda获得的示例项目不同(我没有向控制台输出警告)。

虽然这不是问题,但我想尝试了解此错误的原因。

谢谢!

1 个答案:

答案 0 :(得分:4)

我不是百分百肯定,我无法解释为什么,我不确定这是否有任何帮助,但改变了界限:

if (abs(nowPoint.x - _beginPoint.x) > kDirectionPanThreshold)
    _dragging = YES;
else if (abs(nowPoint.y - _beginPoint.y) > kDirectionPanThreshold)
    self.state = UIGestureRecognizerStateFailed;
SWRevealViewController.m中的

- > - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

为:

if (fabs(nowPoint.x - _beginPoint.x) > kDirectionPanThreshold)
    _dragging = YES;
else if (fabs(nowPoint.y - _beginPoint.y) > kDirectionPanThreshold)
    self.state = UIGestureRecognizerStateFailed;

似乎让我的警告消失了。