Skip to content

Commit c21e1b0

Browse files
committed
Merge pull request #24 from jhersh/master
Fix ordering of adding long press gesture recognizer
2 parents 7d9a444 + 5907db5 commit c21e1b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ - (void)setupCollectionView {
7070
_longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self
7171
action:@selector(handleLongPressGesture:)];
7272
_longPressGestureRecognizer.delegate = self;
73-
[self.collectionView addGestureRecognizer:_longPressGestureRecognizer];
7473

7574
// Links the default long press gesture recognizer to the custom long press gesture recognizer we are creating now
7675
// by enforcing failure dependency so that they doesn't clash.
@@ -80,6 +79,8 @@ - (void)setupCollectionView {
8079
}
8180
}
8281

82+
[self.collectionView addGestureRecognizer:_longPressGestureRecognizer];
83+
8384
_panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self
8485
action:@selector(handlePanGesture:)];
8586
_panGestureRecognizer.delegate = self;

0 commit comments

Comments
 (0)