Utilizing Facebook’s POP animation framework to simplify things, and supply a far more out from the field animation that is dynamic I use a POPBasicAnimation to your card translating it is X and Y origin to a value off the screen.

as soon as this animation is complete I call my delegate function self.delegate?.didEndSwipe(onView: self) and depend on my delegate (which included this SwipeableView as being a subview) to eliminate this SwipeableView as being a subview. This card is currently entirely taken out of the stack as well as its task is performed.

In the event that dragPercentage is certainly not 60% or maybe more, or if the pan gesture’s state is terminated or unsuccessful, i have to animate it straight back to the stack. (more…)