我想用swift做最简单的动画
UIView.animateWithDuration(UINavigationControllerHideShowBarDuration, animations: { () -> Void in
return
})
但是我在调用中得到参数'delay'的Missing argument
有什么想法吗?
最佳答案
UINavigationControllerHideShowBarDuration
是一个Float
,但是duration:
参数的类型为 NSTimeInterval
(这是 Double
的别名)。因此你有
显式转换:
UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration), animations: { () -> Void in
return
})
关于uiview - 可能是 Swift 编译器错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26594164/