uias / Tabman

™️ A powerful paging view controller with interactive indicator bars
https://uias.github.io/Tabman
MIT License
2.84k stars 235 forks source link

😭 Scrolling stops and restarts while panning a UIScrollView #427

Open rainypixels opened 5 years ago

rainypixels commented 5 years ago

New Issue Checklist

Issue Description

This issue is driving me nuts, and I'm really hoping (but afraid) that I'm missing something obvious and tiny here. The .gifs below are the best explanation for the issue I'm experiencing. I have a TabmanViewController subclass that has two pages/view controllers. Each view controller is instantiated from a storyboard, and has a very similar structure:

UIScrollView
  ↳UIStackView
    ↳ UIView
    ↳ UIView
    ↳ ...

I'm leveraging Tabman's auto-insetting capabilities, and as you can see, the insetting is working great. But when I scroll one of the pages, the scrolling stops (even as the pan gesture continues) for a brief distance (p.s. the distance looks eerily equal to the distance of the top inset), and then picks back up. You can see this happening in both directions.

Help! 😭

scrolling-bug.gif

Here you can see what happens when you scroll slowly.

scrolling-bug

swiping-bug.gif

This is a slowed down swipe. Effectively, when you swipe the scroll view, it pauses for a couple of seconds at the switch, and then continues.

swiping-bug

Other useful things

One related thing worth mentioning: I've artificially increased the content size of the scroll views that contain the interface for the pages to be taller than the screen by adding a tall view at the bottom of the stack view (it's the view that's white in the gif). If I leave the stackview's height smaller than the scroll view's height, I see another annoying issue where the scrolling stops at the switch (similar to the the main issue I'm reporting), tries to continue, and then the offset brings the switch back right under the bar. As you keep scrolling, the effect is a stuttered snapping of the switch to the bottom of the bar.

rainypixels commented 5 years ago

Also: thanks for this excellent framework. I'm a longtime Pageboy fanboi and user, and I was elated to find Tabman a few days ago. Apart from your excellent support, Pageboy and Tabman have one of the swiftiest APIs on Github. They're a pleasure to use. 🙏 💯 🥇

msaps commented 5 years ago

@rainypixels thanks for all the detail - will check it out and see what I can find. On first glance it smells like something to do with the UIScrollView oversized content view - but will investigate 😄

Thanks for all the ❤️ - glad you enjoy using them 🚀

rainypixels commented 5 years ago

@msaps — Nudge. Will you be looking at this one anytime soon?

msaps commented 5 years ago

@rainypixels sorry - been crazy busy of late and haven't had much free time. Will try and have a look at it this next week 👍

msaps commented 5 years ago

@rainypixels could you provide me a simple example project with this issue reproducible - I think it's actually related to the constraints in the child view controller rather than a Tabman insetting bug...