Bagusflyer
Bagusflyer

Reputation: 12925

Bypass UIScrollViewDelegate when scroll in UICollectionView

I have a UICollectionView which is a child view of a UIScrollView. Is it possible to bypass the UIScrollViewDelegate when there is a scroll inside the UICollectionView?

Upvotes: 0

Views: 36

Answers (1)

Natarajan
Natarajan

Reputation: 3271

You can check in your UIScrollViewDelegate methods as like below and bypass your implementations inside that method.

Example:

func scrollViewDidScroll(_ scrollView: UIScrollView) {

        guard scrollView != yourCollectionView else{

            return
        }

        //Your implementations goes here
    }

Upvotes: 2

Related Questions