Skip to content

Commit 7d9a444

Browse files
committed
Merge branch 'develop'
2 parents 052c2b5 + 75601c7 commit 7d9a444

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

LXRCVFL Example using Storyboard/LXRCVFL Example using Storyboard/LXCollectionViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#import <UIKit/UIKit.h>
1010
#import "LXReorderableCollectionViewFlowLayout.h"
1111

12-
@interface LXCollectionViewController : UICollectionViewController <LXReorderableCollectionViewDatasource, LXReorderableCollectionViewDelegateFlowLayout>
12+
@interface LXCollectionViewController : UICollectionViewController <LXReorderableCollectionViewDataSource, LXReorderableCollectionViewDelegateFlowLayout>
1313

1414
@property (strong, nonatomic) NSMutableArray *deck;
1515

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
7878
return playingCardCell;
7979
}
8080

81-
#pragma mark - LXReorderableCollectionViewDatasource methods
81+
#pragma mark - LXReorderableCollectionViewDataSource methods
8282

8383
- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath {
8484
PlayingCard *playingCard = [self.deck objectAtIndex:fromIndexPath.item];

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
@property (assign, nonatomic) CGFloat scrollingSpeed;
1313
@property (assign, nonatomic) UIEdgeInsets scrollingTriggerEdgeInsets;
14-
@property (weak, nonatomic, readonly) UILongPressGestureRecognizer *longPressGestureRecognizer;
15-
@property (weak, nonatomic, readonly) UIPanGestureRecognizer *panGestureRecognizer;
14+
@property (strong, nonatomic, readonly) UILongPressGestureRecognizer *longPressGestureRecognizer;
15+
@property (strong, nonatomic, readonly) UIPanGestureRecognizer *panGestureRecognizer;
1616

1717
- (void)setUpGestureRecognizersOnCollectionView __attribute__((deprecated("Calls to setUpGestureRecognizersOnCollectionView method are not longer needed as setup are done automatically through KVO.")));
1818

1919
@end
2020

21-
@protocol LXReorderableCollectionViewDatasource <UICollectionViewDataSource>
21+
@protocol LXReorderableCollectionViewDataSource <UICollectionViewDataSource>
2222

2323
- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath;
2424

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)