swift - Xcode 6 beta 7 UIView.animateWithDuration 调用中的额外参数 'usingSpringWithDamping'

标签 swift animatewithduration xcode6-beta7

我仅在使用 Swift 时遇到此错误,我想知道当前是否有其他人遇到此问题

Extra argument 'usingSpringWithDamping' in call

UIView.animateWithDuration(NSTimeInterval(doctorPracticeDuration), delay: 0.0, usingSpringWithDamping: 0.3, initialSpringVelocity: textAnimationVelocity, options: .CurveEaseInOut, animations: {}, completion: {success in })

我正在使用 Xcode 6 beta 7

有趣的是,这有效:

UIView.animateWithDuration(NSTimeInterval(doctorPracticeDuration), delay: 0.0, options: .Repeat, animations: {}, completion: {finished in })

Swift 是否可能尚不支持使用 Spring 动画?我知道现在还为时尚早...

最佳答案

我花了很多时间才解决这个问题。 Swift 有可怕的错误消息。就我而言,问题与完成 block 有关。

我里面有这个:

label.transform = CGAffineTransformMakeTranslation(label.frame.size*2, 0)

注意到这个问题了吗?我将 CGSize 乘以 2。修复了这个问题并且成功了。

我的建议是检查你的动画/完成 block ,因为问题很可能就是从那里开始的。

关于swift - Xcode 6 beta 7 UIView.animateWithDuration 调用中的额外参数 'usingSpringWithDamping',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25678404/

相关文章:

ios - 如何将值从 ViewController 传递到 UITableView 自定义单元格类

swift - 为什么 layoutIfNeeded() 允许在更新约束时执行动画?

swift - 尝试添加其他文本字段时,为什么我的标签不会更改位置?

ios - 错误 ITMS-9000 : "Missing or invalid signature.

ios - Swift Sprite Kit 重新创建 SKSpriteNode`s

ios - 如何在 Swift 中使用 plist 中的值而不将它们作为 AnyObject 出现?

methods - 不允许部分应用协议(protocol)方法

swift - 标签未显示(Swift 4 SpriteKit)

swift - 为什么 animateWithDuration 淡出而不是淡入?