When using UISnapBehavior to reset a view to the center of the screen I get the expected bounce effect. But after scrolling a UIScrollView that is a subview of the view being snapped the UISnapBehavior dampening seems to have a different base calculation.
My snap behavior is created like this:
guard let recognizerView = recognizer.view else { return }
let snapBehavior = UISnapBehavior(item: recognizer.view.superview!, snapTo: CGPoint(x: recognizerView.superview!.frame.width / 2, y: recognizerView.superview!.frame.height / 2))
snapBehavior.damping = 0.1
animator.addBehavior(snapBehavior)
Before interacting with the scrollview that is subview of recognizerView the snapBehavior exhibits a very exaggerated bounce effect (which is the desired and expected behavior) but after interacting with the scrollview, then triggering the snapBehavior a second time the effect is much faster (less dampening) despite using the exact same dampening constant.
I think this is related to some autolayout bug because the scrollview is positioned with autolayout and it's content size is dynamically calculated by autolayout constraints.
Interestingly enough removing the scrollview causes the dynamic animation to dampen properly once again.