Skip to content

Instantly share code, notes, and snippets.

@wisaruthk
Created April 22, 2016 14:08
Show Gist options
  • Save wisaruthk/11daf97c2f99a8c14d3841504b376c93 to your computer and use it in GitHub Desktop.
Save wisaruthk/11daf97c2f99a8c14d3841504b376c93 to your computer and use it in GitHub Desktop.
เปลี่ยนสี UIView อย่างง่าย
func animateView3(view:UIView){
let animation:CABasicAnimation = CABasicAnimation(keyPath: "backgroundColor")
animation.fromValue = FlatWhite().CGColor
animation.toValue = FlatYellowDark().CGColor
animation.duration = 0.5
//animation.autoreverses = true
view.layer.addAnimation(animation, forKey: "backgroundColor")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment