Last active
January 5, 2019 13:25
-
-
Save myrickchow32/409bcb02efe3d030fc5c8676447c6461 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
func curveAnimation(view: UIView, animationOptions: UIView.AnimationOptions, isReset: Bool) { | |
// Solution: Combine with .allowUserInteraction | |
let combinedAnimationOptions: UIView.AnimationOptions = [animationOptions, .allowUserInteraction] | |
let defaultXMovement: CGFloat = 240 | |
UIView.animate(withDuration: durationOfAnimationInSecond, delay: 0, options: combinedAnimationOptions, animations: { | |
view.transform = isReset ? .identity : CGAffineTransform.identity.translatedBy(x: defaultXMovement, y: 0) | |
}, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment