Skip to content

Instantly share code, notes, and snippets.

@saru2020
Last active October 17, 2019 13:55
Show Gist options
  • Save saru2020/2766095e8f3c1bdc808fb3ceacdfa7b9 to your computer and use it in GitHub Desktop.
Save saru2020/2766095e8f3c1bdc808fb3ceacdfa7b9 to your computer and use it in GitHub Desktop.
let newButtonWidth: CGFloat = 60
UIView.animate(withDuration: 1.0, //1
delay: 0.0, //2
usingSpringWithDamping: 0.3, //3
initialSpringVelocity: 1, //4
options: UIView.AnimationOptions.curveEaseInOut, //5
animations: ({ //6
self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)
self.button.center = self.view.center
}), completion: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment