@@ -54,7 +54,7 @@ @interface LXReorderableCollectionViewFlowLayout ()
5454@property (assign , nonatomic ) CGPoint panTranslationInCollectionView;
5555@property (strong , nonatomic ) NSTimer *scrollingTimer;
5656
57- @property (assign , nonatomic , readonly ) id <LXReorderableCollectionViewDatasource > dataSource;
57+ @property (assign , nonatomic , readonly ) id <LXReorderableCollectionViewDataSource > dataSource;
5858@property (assign , nonatomic , readonly ) id <LXReorderableCollectionViewDelegateFlowLayout> delegate;
5959
6060@end
@@ -67,25 +67,23 @@ - (void)setDefaults {
6767}
6868
6969- (void )setupCollectionView {
70- UILongPressGestureRecognizer *longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc ] initWithTarget: self
71- action: @selector (handleLongPressGesture: )];
72- longPressGestureRecognizer .delegate = self;
73- [self .collectionView addGestureRecognizer: longPressGestureRecognizer ];
70+ _longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc ] initWithTarget: self
71+ action: @selector (handleLongPressGesture: )];
72+ _longPressGestureRecognizer .delegate = self;
73+ [self .collectionView addGestureRecognizer: _longPressGestureRecognizer ];
7474
7575 // Links the default long press gesture recognizer to the custom long press gesture recognizer we are creating now
7676 // by enforcing failure dependency so that they doesn't clash.
7777 for (UIGestureRecognizer *gestureRecognizer in self.collectionView .gestureRecognizers ) {
7878 if ([gestureRecognizer isKindOfClass: [UILongPressGestureRecognizer class ]]) {
79- [gestureRecognizer requireGestureRecognizerToFail: longPressGestureRecognizer ];
79+ [gestureRecognizer requireGestureRecognizerToFail: _longPressGestureRecognizer ];
8080 }
8181 }
82- _longPressGestureRecognizer = longPressGestureRecognizer;
8382
84- UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc ] initWithTarget: self
85- action: @selector (handlePanGesture: )];
86- panGestureRecognizer.delegate = self;
87- [self .collectionView addGestureRecognizer: panGestureRecognizer];
88- _panGestureRecognizer = panGestureRecognizer;
83+ _panGestureRecognizer = [[UIPanGestureRecognizer alloc ] initWithTarget: self
84+ action: @selector (handlePanGesture: )];
85+ _panGestureRecognizer.delegate = self;
86+ [self .collectionView addGestureRecognizer: _panGestureRecognizer];
8987}
9088
9189- (id )init {
@@ -117,8 +115,8 @@ - (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttribut
117115 }
118116}
119117
120- - (id <LXReorderableCollectionViewDatasource >)dataSource {
121- return (id <LXReorderableCollectionViewDatasource >)self.collectionView .dataSource ;
118+ - (id <LXReorderableCollectionViewDataSource >)dataSource {
119+ return (id <LXReorderableCollectionViewDataSource >)self.collectionView .dataSource ;
122120}
123121
124122- (id <LXReorderableCollectionViewDelegateFlowLayout>)delegate {
0 commit comments