iOS 11 navigationbar scroll

855 views Asked by At

so, the setup looks like this: I want to have one navigationbar and three collectionViews. I want to be able to horizontally scroll through the collectionviews and on vertical scroll the navigationBar large title animation should trigger as well.

What I have tried: My first try was to create one horizontally.scrolling collectionView with cells having the size of the whole view and in each cell there would be another collectionView that would scroll vertically. Now, that worked great for my purpose but the large title stayed the same size - which, as I understand, is because it does not receive any vertical scroll events since my collectionViews for vertical scrolling are embedded in main collectionView.

It looked like this: https://giphy.com/gifs/50hYRx71XSdYA/html5

Then I tried a different approach. I created pageViewController and two viewControllers both with one vertically-scrolling collectionView. And ... it did not work either. This time if there was pageCurl animation, the navigation title DID animate - but I do not want a pageCurl animation, you can see that here: https://giphy.com/gifs/jFmOpEtUOyxtC/html5 Changing the animation to .scroll just disabled the title animation: https://giphy.com/gifs/l0IsGVhKKb0lzomqc/html5

I can not find a way to do this, do any of you have any idea?

Thanks!

1

There are 1 answers

0
Tamás Zahola On

Unfortunately the new self-collapsing navigation bar is using some private Apple-magic in the background to hook into the top-level scroll view of the view controller, therefore you cannot use this mechanism the way you've described.