There are several parts here.
- Point of release. It can be "over the line", when view will be removed or "under", when it will return to the starting position.
- Speed during the release. If the speed is high, then "view does have enough energy to go over the line".
So, if the point is "high enough" or the speed is "high enough", we will remove the view, or will return it back otherwise.
Third thing is removal/returning animation. It does need to have inertia to behave more physically correct. You can make simple thing. Let the duration to the "remove window" animation depend on 1/speed. So faster you go, faster the animation will be.
Return animation is a little bit trickier. Window has to go a little bit up and then down. It's where UIKit Dynamics can come handy.
I did all the things except "return animation" for my project and it looks very nice.