Reputation: 117
I have collectionView nested inside a scrollView. Both of which scroll Vertically.
In my main scroll View I want to stop it's scrolling when reaching scrollView.contentOffset.y > someValue, and enable scrolling in collectionView
But I want this to happen in one continuous motion without needing to lift finger in between.
Full view
Upvotes: 2
Views: 692
Reputation: 3271
If you want continues scrolling, you should not stop the scrolling of your main scroll view. And you should set the main scrollView.contentOffset.y
as constant value once it's reached your max offset(scrollView.contentOffset.y > someValue
). And you can increase/decrease the contentOffset.y
of your collectionView as per you main scrollview motion.
Example:
if (scrollView.contentOffset.y > 50) {
scrollView.contentOffset.y = 50.0;
collectionView.contentOffset.y += 1; //you can do your scroll up/down calculation over here
}
Upvotes: 1