Skip to content

Instantly share code, notes, and snippets.

@tbatsuur
Created December 11, 2018 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbatsuur/ac5847babbb936ca3d3bb2004d4a27fc to your computer and use it in GitHub Desktop.
Save tbatsuur/ac5847babbb936ca3d3bb2004d4a27fc to your computer and use it in GitHub Desktop.
func moveGreen() {
let animationTime = 2.0
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 1.0) {
UIView.animate(withDuration: animationTime, delay: 0.0, options: [.autoreverse, .repeat], animations: {
self.greenView.backgroundColor = UIColor.yellow
}, completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment