Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created May 19, 2020 15:42
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 stevencurtis/7b96e0cfd52f386114e0d96751a61d4d to your computer and use it in GitHub Desktop.
Save stevencurtis/7b96e0cfd52f386114e0d96751a61d4d to your computer and use it in GitHub Desktop.
springViewAnimate
springView.backgroundColor = .gray
springView.frame = CGRect(x: 0, y: 500, width: 200, height: 200)
self.view.addSubview(springView)
UIView.animate(
withDuration: 0.5,
delay: 0.5,
usingSpringWithDamping: 0.7,
initialSpringVelocity: 0.8,
options: .curveEaseInOut,
animations: {
self.springView.center = self.view.center
}, completion: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment