Created
May 19, 2020 15:42
-
-
Save stevencurtis/7b96e0cfd52f386114e0d96751a61d4d to your computer and use it in GitHub Desktop.
springViewAnimate
This file contains 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
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