我正試圖在Swift中使用animateWithDuration
關閉。我已經在Apple的Book for Swift中提到了關閉中的參數。但是,我仍然收到錯誤。如何聲明Swift C關閉
下面的代碼片段:
if(!isRotating){
isRotating = true
var myImageTemp :UIImageView = self.myImage
UIView.animateWithDuration(0.5, delay: 1, options: UIViewAnimationCurve.EaseOut, animations:
{
() in myImageTemp.transform = CGAffineTransformMakeRotation(angle + M_PI_2)
},
completion:
{
(Bool finished) in self.pathAnimation() })
}
它給了我一個錯誤:
Could find an overload that accepts the supplied arguments.
並且還告訴我:
Implicit use of self in closure.
任何人可以幫助我嗎?
你的代碼和問題的格式有點混亂。請整理它 - 這會讓人們更容易幫助你。 – ColinE
可能重複[Blocks on Swift(animateWithDuration:animations:completion:)](http://stackoverflow.com/questions/24071334/blocks-on-swift-animatewithdurationanimationscompletion) – Pascal