When this animation is complete I call my delegate function self.delegate?.didEndSwipe(onView: self) and depend on my delegate (which added this SwipeableView as being a subview) to get rid of this SwipeableView being a subview. This card happens to be totally taken out of the stack and its own work is completed.
In the event that dragPercentage just isn’t 60% or maybe more, or if perhaps the pan gestureвЂ™s state is terminated or failed, i have to back animate it to the stack. Typically this animation may be just a little rubber-band-like springy bounce animation that communicates that the swipe failed therefore the individual has вЂlet goвЂ™ regarding the card, allowing it to fling back once again to its initial destination, just as you’ll expect within the real life physics space. (more…)