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

Page sheet dismiss gesture conflict with driving scroll view #55

Open
aabdellah opened this issue Jan 13, 2020 · 3 comments
Open

Page sheet dismiss gesture conflict with driving scroll view #55

aabdellah opened this issue Jan 13, 2020 · 3 comments

Comments

@aabdellah
Copy link

When scrolling down any scroll view in the overlay in view controllers presented using page sheet modal presentation style, the view controller is interactively dismissed.

Page sheet should not be dismissed when scrolling the driving scroll view down. But it could be enabled for other other areas outside the overlay controller.

@gaetanzanella
Copy link
Contributor

Hi @aabdellah, in iOS 13?

Does disabling the drag to dismiss gesture do the trick?

viewController.isModalInPresentation = true

@aabdellah
Copy link
Author

Tried that on the child controller and it still dismisses it, when adding it to the parent view controller there're some glitches when scrolling and it disables the entire swipe gesture.
The workaround that I'm using now is adding a UIRefershControl to the driving scroll view. Because the driving scroll view moves with the overlay, the refresh control never shows. Not ideal but that's how I dealt with it.

I'm not sure if there's a way to disable the sheet dismiss gesture while scrolling the driving scroll view like what happens with most views (pickers, sliders, etc). I think that would be the most ideal fix.

@gaetanzanella
Copy link
Contributor

gaetanzanella commented Jan 15, 2020

Using the UIRefreshControl is a good workaround for tableViews. Not ideal of course. But it should work for a long time. The sheet presentation's implementation is based on the UIScrollView's implementation. They are deeply linked. I will look a bit more soon but it looks like the only way is to create your own sheet presentation.

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

2 participants