SwipeCellKit icon indicating copy to clipboard operation
SwipeCellKit copied to clipboard

Cell not stick

Open diogoAntunes opened this issue 7 years ago • 5 comments

Hey, thank you for this awesome library. I'm trying to find a way so when the user swipes the cell the action occurs immediately so without giving the user a chance for the cell to stick and show the available options

diogoAntunes avatar May 22 '18 12:05 diogoAntunes

Thanks.

You can do this customizing the expansion. Have a look at: https://github.com/SwipeCellKit/SwipeCellKit/blob/develop/Guides/Advanced.md

~~Customize your selection expansion to have a target percentage of 0.0~~

kurabi avatar May 22 '18 19:05 kurabi

Thank you @kurabi I really appreciate the help :) I've already tried that but doesn't seem to work, maybe I explained wrong what I'm trying to accomplish.

2014-10-22 11_35_09

I'm trying to make it so that it's impossible for the user to stay on that state where the swipe option is stuck and he has to swipe. This is the code I got for the options.

func tableView(_ tableView: UITableView, editActionsOptionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeTableOptions {
        var options = SwipeTableOptions()
        options.expansionStyle = SwipeExpansionStyle(target: .percentage(0.0),
                                                     elasticOverscroll: false,
                                                     completionAnimation: .bounce)
        options.transitionStyle = .drag
        options.backgroundColor = .white
        
        return options
    }

diogoAntunes avatar May 22 '18 20:05 diogoAntunes

Thanks for the clarification. This is not possible currently, however I can see this being an easy PR that you or someone can submit. We just need a new SwipeExpansionStyle options that would allow for you and others to do this.

kurabi avatar May 24 '18 02:05 kurabi

Hello, have you been able to achieve this behavior? I am looking for the same as you can see in whatsApp when you drag a message to reply. It always bounce back on release and triggers action only if it was dragged far enough. I am sorry, as I am new to programming, I am not yet capable to extend pod’s functionality. Thanks!

Edit: Would not be possible to add a Bool property for the non-public gesture recognizer to “hideCell() upon gesture finish (end draging)? Perhaps is not necessary to add another expansion style, just have additional “option” to set something like “bounceBackOnRelease = true” that would apply to all curent expansion styles. Is there any roadmap or estimate, when and how the pod would be enchanced/updated? Thanks!

lsmilek1 avatar Jun 11 '19 12:06 lsmilek1

Looking for the same solution as "Gmail" does. Stick icon and just cell moves

jasminpethani avatar Feb 17 '20 14:02 jasminpethani