Skip to content

Instantly share code, notes, and snippets.

@saru2020
Last active October 17, 2019 14:05
Show Gist options
  • Save saru2020/558a666246516aced059adce14fbb064 to your computer and use it in GitHub Desktop.
Save saru2020/558a666246516aced059adce14fbb064 to your computer and use it in GitHub Desktop.
let newButtonWidth: CGFloat = 60
let animator = UIViewPropertyAnimator(duration:0.3, curve: .linear) { //1
self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)
self.button.center = self.view.center
}
animator.startAnimation() //2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment