Animate With BackgroundColor BackgroundImage TextColor

//backgroundColor
UIView.transitionWithView(placeholderLabel, duration: 0.5, options: .TransitionCrossDissolve, animations: { _ in
    self.placeholderLabel.backgroundColor = COLOR_RED_1
}, completion: { _ in
    UIView.transitionWithView(self.placeholderLabel, duration: 1, options: .TransitionCrossDissolve, animations: { _ in
        self.placeholderLabel.backgroundColor = UIColor.clearColor()
    }, completion: nil)
})

UIView.animateWithDuration(duration, animations: { _ in
    self.textView.layer.backgroundColor = button.backgroundColor?.CGColor
    self.addButton.layer.backgroundColor = button.backgroundColor?.CGColor
}, completion: { _ in
    self.textView.backgroundColor = button.backgroundColor
    self.addButton.backgroundColor = button.backgroundColor
})

//backgroundImage
UIView.transitionWithView(navigationController!.navigationBar, duration: duration, options: .TransitionCrossDissolve, animations: { _ in
              self.navigationController?.navigationBar.setBackgroundImage(button.backgroundColor?.toImage(), forBarMetrics: .Default)
}, completion: nil)

//textColor
[UIView transitionWithView:myLabel duration:0.25 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
    myLabel.textColor = NEW_COLOR;
} completion:^(BOOL finished) {
}];

你可能感兴趣的:(background)