-
Notifications
You must be signed in to change notification settings - Fork 168
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
Scrolling UIDatePicker dismisses modal view controller #58
Comments
Thanks for filling an issue. This is a problem with any views that do their own touch handling. I'm still trying to search for solutions, but unfortunately I haven't been able to find one yet. In the meantime all I can recommend is to disable swipe-to-dismiss. |
Thanks, hopefully there is a real fix soon. For the time being I have fixed this by positioning a This seems to trick the DeckTransition into not listening for scroll events on this view. |
I have the same problem with reordering UITableViewCells in the modal view. It would be helpful to enable/disable swipeToDismiss as needed. Is that feasible? |
@gorkemg That's my fallback in case I can't find a better solution. But I'd much rather have it be either declarative or requiring no API change on the user's end if that's doable at all. |
I agree with @gorkemg - I have a collection view which is swiping horizontally. That triggers the 'swipe to dismiss' gesture causing the whole VC to move with every little vertical movement. |
Concerning the previous point I raised, I modified the following function in
|
@cyrilzakka That breaks swipe to dismiss if you’re not at the exact top of the scroll view when you begin the dismiss gesture Sent with GitHawk |
Oh I guess I'll look into it a bit more. What would you suggest I do for horizontal scrolls? I might modify if abs(gestureRecognizer.translation.x) > abs(gestureRecognizer.translation.y) then return false. Thoughts? |
Would’ve implemented it already if I had an exact solution about what to do! Sent with GitHawk |
For anyone interested: you can also avoid running into this issue by placing an UITextField in your interface. All you have to do in code is to set the .inputView attribute to a Date Picker (or a Picker View). Tapping the UITextField will trigger the keyboard launching, which is now set to a Picker View that may be scrolled without any problems. Here is a sample code. I've tested this workaround with iOS 12 and XCode 10.
|
The modal view I am displaying using DeckTransition contains a
UIDatePicker
, when the date picker is swiped to select a date/time this triggers the dismiss gesture. I have reproduced this using the Example project just by adding a UIDateView to the view.Is there a work around to resolve this issue?
The text was updated successfully, but these errors were encountered: