Skip to content

Commit f37c1bb

Browse files
committed
- Fixed incorrect conformation of protocols specified data source and delegate.
1 parent e66c96d commit f37c1bb

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
@end
2020

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

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

@@ -29,7 +29,7 @@
2929

3030
@end
3131

32-
@protocol LXReorderableCollectionViewDelegate <NSObject>
32+
@protocol LXReorderableCollectionViewDelegateFlowLayout <UICollectionViewDelegateFlowLayout>
3333
@optional
3434

3535
- (void)collectionView:(UICollectionView *)collectionView willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ @interface LXReorderableCollectionViewFlowLayout ()
5555
@property (strong, nonatomic) NSTimer *scrollingTimer;
5656

5757
@property (assign, nonatomic, readonly) id<LXReorderableCollectionViewDatasource> dataSource;
58-
@property (assign, nonatomic, readonly) id<LXReorderableCollectionViewDelegate> delegate;
58+
@property (assign, nonatomic, readonly) id<LXReorderableCollectionViewDelegateFlowLayout> delegate;
5959

6060
@end
6161

@@ -121,8 +121,8 @@ - (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttribut
121121
return (id<LXReorderableCollectionViewDatasource>)self.collectionView.dataSource;
122122
}
123123

124-
- (id<LXReorderableCollectionViewDelegate>)delegate {
125-
return (id<LXReorderableCollectionViewDelegate>)self.collectionView.delegate;
124+
- (id<LXReorderableCollectionViewDelegateFlowLayout>)delegate {
125+
return (id<LXReorderableCollectionViewDelegateFlowLayout>)self.collectionView.delegate;
126126
}
127127

128128
- (void)invalidateLayoutIfNecessary {

0 commit comments

Comments
 (0)