Jiar / SegementSlide

Multi-tier UIScrollView nested scrolling solution. 😋😋😋
https://blog.jiar.me/2019/02/13/Multi-tier-UIScrollView-nested-scrolling-solution/
Apache License 2.0
1.3k stars 158 forks source link

The gesture of shielding multi-directional dragging is provided to th… #52

Closed ameue closed 3 years ago

ameue commented 4 years ago

Provide to the outside add other gestures, such as the scroll view in the head.to solve the problem that the head can be dragged horizontally and vertically at the same time.

use like this:

class HomeViewController: SegementSlideDefaultViewController {

    var customHeaderView: HomeHeaderView?

    override func viewDidLoad() {
        self.customHeaderView = HomeHeaderView.headerView()
        super.viewDidLoad()

         //mainView is a UICollectionView
         if let gestureRecognizersInScrollView = customHeaderView?.cycleView.mainView.gestureRecognizers {
             addGesture(getsture: gestureRecognizersInScrollView)
         }
    }
}

class HomeHeaderView: UIView {

    let cycleView = SDCycleScrollView()
}
Jiar commented 3 years ago

Thank you for your contribution, but this doesn't seem like an easy API to use, and we may have to think of a better way to implement it.

ameue commented 3 years ago

3.0.0添加了该功能了吗