Whats the Swift animate WithDuration syntax?

前端 未结 4 834
夕颜
夕颜 2020-12-01 10:29

I\'m porting an older app over to Xcode 7 beta and I\'m getting an error on my animations:

Cannot invoke \'animateWithDuration\' with an argument list

4条回答
  •  独厮守ぢ
    2020-12-01 10:58

    Swift 3, 4, 5

    UIView.animate(withDuration: 1.5, delay: 0.05 * Double(index), usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: {
        cell.transform = CGAffineTransform(translationX: 0, y: 0)
    }, completion: nil)
    

提交回复
热议问题