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

Dynamicly set isSwipeToDismiss #91

Open
horbel opened this issue Sep 22, 2018 · 9 comments
Open

Dynamicly set isSwipeToDismiss #91

horbel opened this issue Sep 22, 2018 · 9 comments

Comments

@horbel
Copy link

horbel commented Sep 22, 2018

Is there a way to change isSwipeToDismissEnabled property after initialization of DeckTransitioningDelegate? I'm trying to do the following thing:
I have a music player view in the modal. There are progress and volume sliders in the player view. And I want to disable isSwipeToDismissEnabled when the user is changing the sliders values.
http://prntscr.com/kxdjky

Thanks in advance

@HarshilShah
Copy link
Owner

This isn’t currently supported, but something like this is in the works. I’ll post a link here when it’s live

@rustyshelf
Copy link

Not to bump an old thread but in case it helps I too was looking for this feature today :)

@HarshilShah
Copy link
Owner

Noted, always helpful to get +1s. It’s one of the important features for the major updates that’s in the works (more about it on #109). I’ve been sidetracked a bit working on some other stuff, but I expect to have time to work on it soon, and I will make the branch public as soon as I have something that is testable.

@rustyshelf
Copy link

Great to know. If it helps you at all I hacked this into my fork (which no one should use, it's too custom and hacky) but in case it gives you any ideas:
rustyshelf@984814e

@HarshilShah
Copy link
Owner

Feeling good that it wasn’t that hard to hack in! Keeping with the UIViewController.isModalInPresentation property on iOS 13 I’m inclined to have a similarly named property on DeckPresentationController, and maybe even defer the to UIVC one on iOS 13 and above (though I’m less certain about this bit). Only tricky thing is that the card’s response to dragging is completely different for when dismissal is allowed versus not, which is going to be a bit of a hassle to handle for when the property is updated during a pan.

@rustyshelf
Copy link

In my case I wanted it specifically for the case where I had a re-arrangeable table view so i didn’t have to worry about that interaction. I was going to add rearrange detection to the library instead but there didn’t seem to be a good way to do that with UIKit. So I only disable it during a rearrange operation to stop the dismiss pan gesture from interfering with it

@HarshilShah
Copy link
Owner

HarshilShah commented Nov 29, 2019

Ah is this for the new UIKit two finger selection gesture? I hadn’t considered it at all, adding it to the list of things to test against!

@rustyshelf
Copy link

No just a standard UITableView in edit mode with re-arrange handles. Unless I've missed something obvious dragging down on those tries to close the deck card.

@HarshilShah
Copy link
Owner

Yeah that seems right. Another thing added to the list!

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

No branches or pull requests

3 participants