modocache / MDCSwipeToChoose

Swipe to "like" or "dislike" any view, just like Tinder.app. Build a flashcard app, a photo viewer, and more, in minutes, not hours!
MIT License
2.55k stars 421 forks source link

Programatic Swipe not firing callback fix #111

Closed abury closed 8 years ago

abury commented 8 years ago

Resolves a bug for situations where programmatic swipes don't trigger a delegate callback.

In my project (Swift 2.0, Xcode 7.1) mdc_directionOfExceededThreshold is not returning a reliable value because mdc_viewState.originalCenter is always 0 when set and is only updated upon the pan gesture recogniser firing. I'm not sure why this is occurring (I'm using Autolayout, perhaps that's why?) This small refactor fixes the bug and allows for more internal flexibility.

Should also resolve #34

P.S Awesome Framework.