Last active
January 5, 2019 13:21
-
-
Save myrickchow32/4ba8f2ab001ac1a6b7b30c18c422ca1f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func transitionAnimation(view: UIView, animationOptions: UIView.AnimationOptions, isReset: Bool) { | |
| // Combine transition annimation option with other animation options | |
| let combinedAnimationOptions: UIView.AnimationOptions = [animationOptions, .allowUserInteraction, .autoreverse, .repeat] | |
| UIView.transition(with: view, duration: durationOfAnimationInSecond, options: combinedAnimationOptions, animations: { | |
| view.backgroundColor = UIColor.init(named: isReset ? "darkGreen" : "darkRed") | |
| }, completion: nil) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment