Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added lock to move the card on an axis #65

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

andre991
Copy link

Added the Axis enum to allow card to move from a unique axis or both.
Issue #64

@andre991
Copy link
Author

@mac-gallagher I added an enum to drag card from a unique axis.

@mac-gallagher
Copy link
Owner

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

@andre991
Copy link
Author

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?

@mac-gallagher
Copy link
Owner

mac-gallagher commented May 24, 2020

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

horizontal_swipe_all 2020-05-23 17_05_52

and here is a horizontal swipe with Axis.horizontal:

horizontal_swipe_horizontal 2020-05-23 16_56_52

@andre991
Copy link
Author

Hi @mac-gallagher, sorry for the delay.

The axis is to block card movement for other Axis.

Look at the mouse movement.

@andre991
Copy link
Author

Axis.all
The card movements in all axis.
ezgif com-video-to-gif

@andre991
Copy link
Author

Axis.horizontal
The card movements only in horizontal axis(see the mouse).
ezgif com-video-to-gif (1)

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2020

Codecov Report

Merging #65 into master will decrease coverage by 1.0%.
The diff coverage is 44.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%> (ø)

@mac-gallagher
Copy link
Owner

mac-gallagher commented May 29, 2020

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

Example/TinderExample/TinderViewController.swift Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Shuffle-iOS.podspec Outdated Show resolved Hide resolved
Sources/Shuffle/Axis.swift Show resolved Hide resolved
Sources/Shuffle/Axis.swift Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants