Skip to content

Instantly share code, notes, and snippets.

@tbatsuur
Created December 11, 2018 01:13
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/a17ac544d291e4b1ad48802880ee370c to your computer and use it in GitHub Desktop.
Save tbatsuur/a17ac544d291e4b1ad48802880ee370c to your computer and use it in GitHub Desktop.
func moveBlue() {
let animationTime = 2.0
let newView = UIView(frame: self.blueView.frame)
newView.backgroundColor = UIColor.purple
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 1.0) {
UIView.transition(from: self.blueView, to: newView, duration: animationTime, options: [.transitionFlipFromLeft, .repeat, .autoreverse], completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment