Direction limitation of UIPanGestureRecognizer

UIPanGestureRecognizer

Why should we add limit?

UISwipeGestureRecognizer has direction limitation.
But this recognizer doesn’t have tracking feature of target UIView.
It means that UISwipeGestureRecognizer cannot detect UIGestureRecognizerStateBegin and UIGesture
while swiping.

Situation

We face the problem.
We want to use swipe left,right and UICollectionView at the same UI. Also need drag and drop feature in collection cell.
Direction of UICollectionView swipe is up and down. To use both, we have to prevent up and down in UIPanGestureRecognizer.