5

I have a nested scroll view situation such as follow-

mainView->ScrollView1->ScrollView3(has many child ScrollView vertical)

enter image description here

*I want that when that when the user scrolls down then,first the scrollView1 will scroll dragging the displayed childScrollView3 along with it.(scrollView2's user interaction as well as scroll should be disabled)*

2)*And after it has reached its end the childScrollView3 will scroll with the same velocity that scrollView1 was scrolling ?*

Same should happen when user scrolls downward i.e childScrollView3 will first come to its end & then the scrollView1 shall scroll to top.

UPDATE

Mark - I searched on goole for parallax but that was not helpful as I have a paging scroll view with multiple vertical child scrolls.

Kamala Dash
  • 245
  • 3
  • 16

1 Answers1

0

override the func scrollViewDidScroll(_:) in UIScrollViewDelegate method to watch for the fine grain scrolling of the UIScrollViews.

You can use the contentOffset variable of the scrollView to find when you should start scrolling the next one. You'll have to do some math to determine how much the scrollView the user is touching was offset in-between calls of this method to determine how much to scroll the next scrollView by to keep the "animation" the same across both.

tokan_one
  • 899
  • 7
  • 14
  • Good suggestion but....eg - my scrollView1 has to scroll for y=150 & then my horizontal scroll i.e horizontalScrollView3 has to be dragged upto 150 points up alongwith the scrollView1 & then the childScrollView3 will scroll without breaking i.e the scroll should be continuous without any chop. Can you please suggest some demo codes....that would be really very helpful. – Kamala Dash Mar 03 '16 at 04:27