我找不到调用UIView方法animateWithDuration的正确语法。我发现了一些其他人遇到过类似问题的例子,而这些解决方案似乎并不适用于最新版本的Swift 2.0。我得到这个通用错误:无法使用类型为'(...)'的参数列表调用'animateWithDuration'
无法用类型为'(duration:Double,delay:Double,options:UIViewAnimationTransition,animations:() - > _,completion:nil)的参数列表调用'animateWithDuration' '
我相信我已经将问题缩小到“动画:”参数。这里是我的代码:
UIView.animateWithDuration(duration: 0.2,
delay: 0.0,
options: UIViewAnimationTransition.FlipFromLeft,
animations: {
// Hide image here
},
completion: nil)
任何建议,将不胜感激,谢谢。
此代码编译,但我需要一个接受的animateWithDuration方法“选项:”参数,这样我可以翻转图像部分。我试图实现类似于此的瓦动画:http://stackoverflow.com/questions/12292431/image-spliced-into-tiles-with-animation-ios – Bast1472
谢谢,这是问题! – Bast1472