I know that there are multiple ways (CAAnimation, commitAnimations, etc), but what is the simplest way?
I'd like the UIView to start from blue and then fade to clear (or white, whatever is easier) in X milliseconds.
You can use UIView
's animation method. It's much simpler than the other animations, but is more limited. Luckily, backgroundColor
is one of the animatable ones. Example:
self.view.backgroundColor = UIColor.blueColor()
UIView.animateWithDuration(1.0, animations: {
self.view.backgroundColor = UIColor.clearColor()
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With