I have a nested UIScrollView
inside another one, both are horizontal.
The outer one contains multiple UIScrollViews
, let's say one per page (of a document with multiple pages).
The inner one can contain just a UIView
that fits the screen or maybe some bigger UIView
that should be scrolled too (tipically horizontally, but if the user pinches the screen, then he could scroll in both directions).
The problem occurs when I fastly scroll the document and the outer scroll view just decides to scroll its subviews, without letting the inner scroll views (those whose contentSize is bigger than the screen size) scroll at all. If I gently scroll the outer scroll view, it instead lets the inner one scroll too.
The desired behavior is that even if I fastly scroll the outer scroll view, it should scroll the inner one, until its content has been completely shown and only then let the outer scroll view scroll.
I tried overriding hitTest:withEvent:
so that the outer scroll view should ask its currently visible UIScrollView
subview if it should scroll or not, but this currently only works when scrolling forward. The problem is that I can't detect scrolling direction in hitTest:withEvent:
, so I'm also thinking about moving this code into somewhere else, but I don't know if it's the correct way to go.
I'm sorry for all the "scroll" word in the sentences, but I don't know how to explain this in a better way