MDCSwipeToChoose icon indicating copy to clipboard operation
MDCSwipeToChoose copied to clipboard

Programmatically Swipe does not perform Animation correctly

Open confile opened this issue 9 years ago • 9 comments

In the SwiftLikedOrNope sample when you click the buttons to swipe programmatically the swipe animation is not performed. You do not see the "liked" or "nope" and the card does not rotate. It just vanishes.

Could you please fix that.

confile avatar May 14 '15 15:05 confile

+1

steffimueller avatar May 14 '15 19:05 steffimueller

It only works when you first drag the card by hand a little bit.

This should be fixed. @modocache Do you have any idea for a workaround?

steffimueller avatar May 14 '15 19:05 steffimueller

@vikmeup Any idea on this issue?

confile avatar May 21 '15 12:05 confile

I had a similar issue, with a console error: <Error>: CGAffineTransformInvert: singular matrix.

My error was due to the originalTransform not being set at setup, here: https://github.com/modocache/MDCSwipeToChoose/blob/v0.2.3/MDCSwipeToChoose/Public/Views/UIView+MDCSwipeToChoose.m#L42

This has since been fixed on master: https://github.com/modocache/MDCSwipeToChoose/blob/master/MDCSwipeToChoose/Public/Views/UIView+MDCSwipeToChoose.m#L42

... but was not available in the podspec version. Until the podspec is updated, I work around by changing my Podfile to:

pod 'MDCSwipeToChoose', :head

jeanfw avatar May 26 '15 10:05 jeanfw

@jeanfw when I add that line I get the following error:

Assigning to 'CGAffineTransform' (aka 'struct CGAffineTransform') from incompatible type 'CATransform3D' (aka 'struct CATransform3D')

acegreen avatar May 31 '15 04:05 acegreen

@acegreen Yes I also had the same error when just adding the line, but ultimately went for updating the whole POD, and that worked for me.

jeanfw avatar May 31 '15 09:05 jeanfw

Thanks for the feedback. I made too many changes to update my pod. Not sure how thats handled as I'm new to this whole pod thing

acegreen avatar May 31 '15 14:05 acegreen

its actually self.mdc_viewState.originalTransform = self.transform;

without .layer

acegreen avatar May 31 '15 15:05 acegreen

This was driving me crazy today, thanks for the solution guys, the :head version of the podspec works. @modocache , this issue can be closed.

rafalio avatar Jul 11 '15 21:07 rafalio