Reputation: 272204
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.
Upvotes: 5
Views: 2601
Reputation: 3400
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()
})
Upvotes: 11