Whats the Swift animate WithDuration syntax?

前端 未结 4 843
夕颜
夕颜 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:47

    Swift 3 Syntax with completion block

    UIView.animate(withDuration: 3.0 , delay: 0.25, options: .curveEaseOut, animations: {
    
            // animation
        }, completion: { _ in
    
            // completion
        })
    

提交回复
热议问题