// 動畫方法,引數說明:執行時間,延遲時間,移動效果,具體方法,結束後執行方法。
UIView.animateWithDuration(0.3, delay: 0.1, options: .CurveEaseOut, animations: {
// 位移
// self.view.frame.origin.x = 100
// 扭曲
// self.view.transform.c = 0.8
// 旋轉
self.view.transform = CGAffineTransformMakeRotation(CGFloat(90*M_PI/180.0))
// 縮放
self.view.transform = CGAffineTransformScale(self.view.transform, 0.8, 0.8)
println("(self.view.frame.origin.x)")
}, completion: {
finished in println("basket doors opened!")
UIView.animateWithDuration(0.2, delay: 0.0, options: nil, animations: {
self.view.frame.origin.x = 520.0
}, completion: nil)
})
最簡單的demo。