subinspathilettu / SJSegmentedViewController

MIT License
334 stars 126 forks source link

Scroll does not work if using regular collection view #146

Open JayceBryce opened 4 years ago

JayceBryce commented 4 years ago

This is the issue:

If we want to use a UICollectionView which we add to a ViewController ( NOT UICollectionViewController ) which we can use directly from storyboards the scroll header does not work. When you scroll up the "Header" is also suppose to scroll up but instead it does not.

On the sample project it works because your using a UICollectionViewController.

Can you please fix this?

emalindahk commented 3 years ago

@JayceBryce Adds this to your view controller

extension ViewController: SJSegmentedViewControllerViewSource {
    func viewForSegmentControllerToObserveContentOffsetChange() -> UIView {
        return collectionView
    }
}