swift - SWReveal - CoreAnimation 警告 : stiffness/damping must be greater than 0

标签 swift swrevealviewcontroller

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

我从 here 下载了 SWReveal(最新 = v2.4)并按照 AppCoda 上的教程进行操作.

在独立项目中我没有遇到任何问题。但是在我的应用程序中(仍然作为一组独立的 View Controller /表运行,我收到了这两个警告:

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

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

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

谢谢!

最佳答案

我不是 100% 确定,我无法解释原因,我不确定这是否有任何帮助,但换行:

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;

似乎让我的警告消失了。

关于swift - SWReveal - CoreAnimation 警告 : stiffness/damping must be greater than 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33390184/

相关文章:

swift - 键入时检查 UITextField 中的字符串长度

ios - 在 swift 2 中解析 json 对象

dictionary - 快速空字典错误? Playground vs 项目

ios - 当用户点击 View Controller 时如何使 SWRevealViewController 菜单消失

ios - 在 swrevealviewcontroller 中显示导航栏

swifty 并分配数组

ios - Swift Codable 无法仅自定义所需的按键

ios - 在 SWRevealViewController 的情况下, mask View 不会从 super View 中删除

ios - 禁用用户交互但允许在 UIViewController 中点击手势

ios - 如何以编程方式配置 SWRevealViewController?