Skip to content

Swipe left and right on button click  #1

Open

Description

@davy-devibharat

Hi,
Thanks for you help,
How can I Swipe left and right on button click
as when I click Like and Dislike button card should auto Swipe

Your response will be helpful to me

Thanks

Activity

  1. dadalar commented on Jul 7, 2020

    @dadalar
    Owner

    Hi @devorblackbeard,

    I tried a few tricks - you can remove the current element from your array but the tricky part is to get proper animation. If you have a solution I'm glad to incorporate but for now it seems I need to change fundamentals to support this. Anyway, I'll keep this in mind for the next version.

    Thanks for your input.

  2. zkhalapyan commented on Aug 21, 2020

    @zkhalapyan

    +1, this would be great to have! I wonder if we can collaborate on this; if you have any pointers, I can try it out.

  3. dadalar commented on Sep 3, 2020

    @dadalar
    Owner

    The main issue is animating the card out of the screen programmatically. There is already a hard to notice problem where when you drag a card and lift off your finger, the card start animating but also goes behind other cards. This looks like an undefined behaviour and probably we should be using a custom transition/animation instead of the one we have in CardView.swift's removal transition (line 71).

  4. timothyerwin commented on Jan 16, 2021

    @timothyerwin

    @dadalar this component is working very well for swipe but unfortunately not having a programmatic way to do it is a showstopper....

  5. nomadplanet commented on Apr 26, 2022

    @nomadplanet
    Contributor

    Hi,

    I spent quite a few hours on this and indeed the project needs a substantial rework in order to have a programmatic swipe.

    I achieved this result :

    Simulator Screen Recording - iPod touch (7th generation) - 2022-04-26 at 15 18 44

    I even have an «unswipe» (undo) function.

    Not sure @dadalar would want a PR on his repo given it's almost a rewrite. Yet you can have a look at my work in my rework branch in my fork.

  6. Mcrich23 commented on Jun 14, 2022

    @Mcrich23

    @nomadplanet How are you doing the undo?

  7. nomadplanet commented on Jun 14, 2022

    @nomadplanet
    Contributor

    Like I said, check out my rework branch in my fork, you'll have your answer :)

  8. Mcrich23 commented on Jun 14, 2022

    @Mcrich23

    I don't see your fork

  9. nomadplanet commented on Jun 15, 2022

    @nomadplanet
    Contributor

    I got it transferred to another account. Check out https://github.com/bruxless/SwiftUI-CardStackView

  10. wellsfletcher commented on Oct 22, 2022

    @wellsfletcher

    @nomadplanet your changes work great! I did notice that the model.unswipe() function doesn't have a completion handler like the model.swipe() function does. Small issue, but I have to do a pretty cringe workaround to fix a bug due to this.

  11. nomadplanet commented on Oct 24, 2022

    @nomadplanet
    Contributor

    Unswiping is not really different from swiping, I don't think it would be too hard to call the onSwipe() completion handler at some point

  12. aehlke commented on Apr 28, 2023

    @aehlke

    anyone finding luck with this new fork, or making progress in other ways? thanks

  13. yildirimatcioglu commented on Oct 29, 2024

    @yildirimatcioglu

    any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions