notsobigcompany / BigUIPaging

A collection of SwiftUI views for handling pages of content
258 stars 15 forks source link

PageVIew intercepting scroll gesture in a ScrollVIew #7

Open kwikysw opened 2 months ago

kwikysw commented 2 months ago

Unfortunately when we use PageView in a ScrollVIew, the scroll gesture is intercepted by the PageView, making it impossible to scroll down or up when the finger is on the PageView. This would be great if there was a minimumDistance modifier like 25 applied to the gesture.

coratype commented 2 months ago

i am having the same issue. did you come up with a fix? apples implementation in iMessage doesnt seem to have the problem.

kwikysw commented 2 months ago

@coratype I forked the project to change the mi minimum scroll distance of the drag gesture to 25. It was only 5 before

coratype commented 2 months ago

say im using 2 scroll views

the parent/root is a horizontal paging scroll view, so i can swipe at any time to the left to reveal a sidebar basically (2nd page)

the first page however is a vertical scroll view with actual content, this is where the cards are

the 25 minimum distance works to prevent the main/vertical scroll view from being blocked.

but it also makes it so the outer horizontal paging scroll view prevents a horizontal card swipe from doing anything.

swiping on card view basically makes ti so i always reveal the sidebar instead

kwikysw commented 2 months ago

@coratype Is it the same with a.simultaneousGesture modifier too ? Or a custom gesture recognizer delegate ? https://developer.apple.com/documentation/uikit/touches_presses_and_gestures/coordinating_multiple_gesture_recognizers/preferring_one_gesture_over_another I honestly don’t know since I’ve never had this situation but if you find a solution, keep me updated

hongyinull commented 1 week ago

@coratype I also encountered the same problem and would like to ask if your forked project has solved this issue ;D

coratype commented 1 week ago

i actually did not fix it because i abandoned the card stack interface but i knew how, you have to make a UIGestureRecognizerRepresentable which was introduced in iOS18

Kavsoft on YouTube has a video recently where he uses it, try that out

https://youtu.be/vqPK8qFsoBg?si=9PMok1zU_m_IIV3Y

hongyinull commented 1 week ago

@coratype Thanks a lot 😄 but I decided to skip the card stack idea too because I don't want to make it too complicated. Thanks again!