Last active
November 13, 2017 07:43
-
-
Save cjinghong/c47e43ac846a1e3bd6cb72e677d583cf to your computer and use it in GitHub Desktop.
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
let timing = UICubicTimingParameters(animationCurve: .easeOut) | |
// A global animator variable is already defined | |
animator = UIViewPropertyAnimator(duration: 2.0, timingParameters:timing) | |
animator.addAnimations { | |
square.center = CGPoint(x: 300, y: square.center.y) | |
square.transform = CGAffineTransform(rotationAngle: CGFloat.pi) | |
} | |
animator.startAnimation() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment