Skip to content

Commit 9197b44

Browse files
committed
really clean-up gesture recognizers
1 parent 086deda commit 9197b44

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

LXRCVFL Example using Storyboard/LXRCVFL Example using Storyboard/LXCollectionViewController.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "LXCollectionViewController.h"
1010
#import "PlayingCard.h"
1111
#import "PlayingCardCell.h"
12+
#import "LXReorderableCollectionViewFlowLayout.h"
1213

1314
// LX_LIMITED_MOVEMENT:
1415
// 0 = Any card can move anywhere
@@ -20,6 +21,8 @@ @implementation LXCollectionViewController
2021

2122
- (void)viewDidLoad {
2223
[super viewDidLoad];
24+
// self.collectionView.collectionViewLayout = [LXReorderableCollectionViewFlowLayout new];
25+
// self.collectionView.collectionViewLayout = [LXReorderableCollectionViewFlowLayout new];
2326

2427
self.deck = [self constructsDeck];
2528
}

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
126126
}
127127

128128
- (void)dealloc {
129-
[self.collectionView removeGestureRecognizer:self.panGestureRecognizer];
130-
[self.collectionView removeGestureRecognizer:self.longPressGestureRecognizer];
129+
130+
[self.panGestureRecognizer.view removeGestureRecognizer:self.panGestureRecognizer];
131+
[self.longPressGestureRecognizer.view removeGestureRecognizer:self.longPressGestureRecognizer];
132+
131133
[self invalidatesScrollTimer];
132134
[self removeObserver:self forKeyPath:kLXCollectionViewKeyPath];
133135
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil];

0 commit comments

Comments
 (0)