Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created May 20, 2020 08:04
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/523ad68643e3e309aba7b57f89b8a6c4 to your computer and use it in GitHub Desktop.
Save stevencurtis/523ad68643e3e309aba7b57f89b8a6c4 to your computer and use it in GitHub Desktop.
Nestedanimation
UIView.animate(withDuration: 1.0, animations: {
self.animateView.center = self.view.center
}){ _ in
UIView.animate(withDuration: 1.0, animations: {
let transformation = CGAffineTransform(rotationAngle: 45)
let scale = CGAffineTransform(scaleX: 1.5, y: 1.5)
self.animateView.transform = transformation.concatenating(scale)
})
{ _ in
UIView.animate(withDuration: 1.0, animations: {
self.animateView.center = CGPoint(x: self.view.frame.width + 100, y: self.animateView.frame.midY)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment