Tweak gallery spring animation parameters

This commit is contained in:
Shadowfacts 2020-09-12 10:48:57 -04:00
parent 9534f19262
commit e21dceb3b3
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ extension LargeImageAnimatableViewController {
class LargeImageExpandAnimationController: NSObject, UIViewControllerAnimatedTransitioning {
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return 0.5
return 0.4
}
func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
@ -90,7 +90,7 @@ class LargeImageExpandAnimationController: NSObject, UIViewControllerAnimatedTra
let duration = transitionDuration(using: transitionContext)
let velocity = 1 / CGFloat(duration)
UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: 0.65, initialSpringVelocity: velocity, options: []) {
UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: 0.75, initialSpringVelocity: velocity, options: []) {
imageView.frame = finalFrame
imageView.layer.cornerRadius = 0
toVC.view.alpha = 1