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

Suggestion: Swipe Back #6

Open
pedrommcarrasco opened this issue Apr 21, 2023 · 8 comments
Open

Suggestion: Swipe Back #6

pedrommcarrasco opened this issue Apr 21, 2023 · 8 comments
Labels
feature New feature or request

Comments

@pedrommcarrasco
Copy link

It would be great if it was possible to configure the Deck to be bidirectional as in:

  • Swiping Right would push the current card to the bottom and show the next one
  • Swiping Left would push the bottom card to the top
@danielsaidi
Copy link
Owner

Hi @pedrommcarrasco

Good idea - I've so far implemented this with a "back" button, but it'd be great to have it purely gesture based!

I'm a bit curious tho how to make it feel intuitive from a skeuomorphic pop, when you're actually swiping the top card. I guess the bottom card could then be the one affected by the animation.

I also guess it'd make sense to configure each direction?

@danielsaidi danielsaidi added the feature New feature or request label Apr 24, 2023
@pedrommcarrasco
Copy link
Author

I guess the bottom card could then be the one affected by the animation.

Exactly!

I also guess it'd make sense to configure each direction?

Yes, makes sense 👍

@aehlke
Copy link

aehlke commented Apr 28, 2023

This is essential for flashcard type apps. Right means correct/yes, left means wrong/no. Usually going to the back of the stack is the default but may also be ejected w some logic (ideally in a callback that can intervene) for example when getting a card wrong repeatedly it's nice to stop showing it to the user for a while.

@danielsaidi
Copy link
Owner

Cool, it should be pretty easy to fix.

Any ideas regarding how to best design the api are more than welcome 👍

@danielsaidi
Copy link
Owner

@pedrommcarrasco @aehlke I don't know if this is still relevant to you, but I'd love to get it working. Do you have an example that I can look at for inspiration?

@aehlke
Copy link

aehlke commented May 23, 2024

I haven't picked up that work yet, won't get to this for some more months

@aehlke
Copy link

aehlke commented May 23, 2024

You might use https://github.com/dadalar/SwiftUI-CardStackView as reference (though it's unmaintained now so see /network for its updated forks)

@danielsaidi
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants