Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- func scrollViewDidScroll(_ scrollView: UIScrollView) {
- if scrollView == rootScrollView {
- if isParentViewCanScroll == false {
- rootScrollView.contentOffset.y = headerStickyHeight // point A
- isChildViewCanScroll = true
- } else if scrollView.contentOffset.y >= headerStickyHeight {
- rootScrollView.contentOffset.y = headerStickyHeight
- isParentViewCanScroll = false
- isChildViewCanScroll = true
- }
- } else {
- if isChildViewCanScroll == false {
- childScrollView.contentOffset.y = 0 // point B
- } else if scrollView.contentOffset.y <= 0 {
- isChildViewCanScroll = false
- isParentViewCanScroll = true
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement