Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let firstTransition: CGFloat = -52
- let secondTransition: CGFloat = -40
- UIView.animateKeyframes(withDuration: 0.8,
- delay: 0.7,
- options: UIViewKeyframeAnimationOptions(rawValue: 0),
- animations: {
- UIView.addKeyframe(withRelativeStartTime: 0,
- relativeDuration: 0.2,
- animations: {
- self.avatarImageView.setTransform(rotationInDegrees: -35)
- })
- UIView.addKeyframe(withRelativeStartTime: 0,
- relativeDuration: 0.3,
- animations: {
- self.avatarImageView.center.x += firstTransition
- })
- UIView.addKeyframe(withRelativeStartTime: 0.2,
- relativeDuration: 0.2,
- animations: {
- self.avatarImageView.center.x += secondTransition
- })
- UIView.addKeyframe(withRelativeStartTime: 0.4,
- relativeDuration: 0.2,
- animations: {
- self.avatarImageView.setTransform(rotationInDegrees: -29.5)
- })
- UIView.addKeyframe(withRelativeStartTime: 0.6,
- relativeDuration: 0.1,
- animations: {
- self.avatarImageView.setTransform(rotationInDegrees: -30.5)
- })
- UIView.addKeyframe(withRelativeStartTime: 0.7,
- relativeDuration: 0.1,
- animations: {
- self.avatarImageView.setTransform(rotationInDegrees: -30)
- })
- }, completion: { _ in
- self.avatarImageView.snp.updateConstraints { (make) in
- make.right.equalToSuperview().offset(self.avatarImageViewWidth + firstTransition + secondTransition)
- }
- …
- }
Add Comment
Please, Sign In to add comment