SimultaneouslyScrollView icon indicating copy to clipboard operation
SimultaneouslyScrollView copied to clipboard

For small content scroll views, prevent "offscreen" scroll

Open loopingGIT opened this issue 2 years ago • 1 comments

This is more a question than an issue, I have two lists, one with 20+ rows and another with 5. When scrolling the larger one, it moves the smaller one content out of screen. Was wondering if this could be prevented here, with something like:

scrollViewsStore.allObjects
            .filter { $0 != lastScrollingScrollView }
            .forEach { 
    if $0.contentIsBiggerThanScrollOffset(scrollView.contentOffset) {
        $0.setContentOffset(scrollView.contentOffset, animated: false)
    }
 }

Attached a video to show what I mean. Thanks

https://github.com/stonko1994/SimultaneouslyScrollView/assets/4581399/190cd657-1463-4e87-949d-a1f2d2649c2b

loopingGIT avatar Jun 13 '23 15:06 loopingGIT

I think technically this should be doable as all the information should be available on the UIScrollView 🤔

If you wanna play around with it feel free to open a PR otherwise I will look at it when time allows 🙂

stonko1994 avatar Jun 14 '23 09:06 stonko1994