Shuffle
Shuffle copied to clipboard
Added lock to move the card on an axis
Added the Axis enum to allow card to move from a unique axis or both. Issue #64
@mac-gallagher I added an enum to drag card from a unique axis.
Hey @andre991 thanks for opening this pull request. I tried the same thing after you opened #64, but the cards behave unexpectedly in the example project. If you drag horizontally, the card slides downwards because there is a rotation angle on the card animation options. It may require some changes to card.layer.anchorPoint. Let me know if you figure anything out
Hi @mac-gallagher I will test this in example project, but in my project the animation looks normal. The rotation is work perfectly for me. You have an gif to share?
Here's what a horizontal swipe looks like with Axis.all (current behavior in Shuffle).
Notice how the center of the card stays on the horizontal axis

and here is a horizontal swipe with Axis.horizontal:

Hi @mac-gallagher, sorry for the delay.
The axis is to block card movement for other Axis.
Look at the mouse movement.
Axis.all
The card movements in all axis.

Axis.horizontal
The card movements only in horizontal axis(see the mouse).

Codecov Report
Merging #65 into master will decrease coverage by
1.0%. The diff coverage is44.4%.
@@ Coverage Diff @@
## master #65 +/- ##
========================================
- Coverage 82.3% 81.2% -1.1%
========================================
Files 13 14 +1
Lines 656 672 +16
========================================
+ Hits 540 546 +6
- Misses 116 126 +10
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...le/SwipeCardStack/CardStackTransformProvider.swift | 0.0% <ø> (ø) |
|
| Sources/Shuffle/Axis.swift | 37.5% <37.5%> (ø) |
|
| ...rces/Shuffle/SwipeCard/CardTransformProvider.swift | 100.0% <100.0%> (ø) |
|
| Sources/Shuffle/SwipeCard/SwipeView.swift | 100.0% <100.0%> (ø) |
Hey @andre991 yes I understand - your change blocks the card movements in the specified directions just fine. However, I would expect everything else to remain the same. The card follows different trajectories for a horizontal drag with Axis.all and Axis.horizontal. They will need to be the same before merging this change