This repository was archived by the owner on Oct 10, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
DRCollectionViewTableLayout Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -194,18 +194,34 @@ - (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndex
194
194
NSUInteger row = [(DRCollectionViewTableLayout *)collectionView.collectionViewLayout rowNumberForIndexPath: indexPath];
195
195
NSUInteger column = [(DRCollectionViewTableLayout *)collectionView.collectionViewLayout columnNumberForIndexPath: indexPath];
196
196
197
- [self .delegate collectionViewTableLayoutManager: self
197
+ SEL selector = @selector (collectionViewTableLayoutManager:collectionView:didDeselectCellAtRow:column:indexPath: );
198
+
199
+ if ([self .delegate respondsToSelector: selector]) {
200
+
201
+ [self .delegate collectionViewTableLayoutManager: self
198
202
collectionView: collectionView
199
203
didDeselectCellAtRow: row
200
204
column: column
201
205
indexPath: indexPath];
206
+ }
202
207
}
203
208
204
209
- (BOOL )collectionView : (UICollectionView *)collectionView shouldSelectItemAtIndexPath : (NSIndexPath *)indexPath {
205
210
NSUInteger row = [(DRCollectionViewTableLayout *)collectionView.collectionViewLayout rowNumberForIndexPath: indexPath];
206
211
NSUInteger column = [(DRCollectionViewTableLayout *)collectionView.collectionViewLayout columnNumberForIndexPath: indexPath];
207
212
208
- return [self .delegate collectionViewTableLayoutManager: self collectionView: collectionView shouldSelectItemAtRow: row column: column indexPath: indexPath];
213
+ SEL selector = @selector (collectionViewTableLayoutManager:collectionView:shouldSelectItemAtIndexPath:column:indexPath: );
214
+
215
+ if ([self .delegate respondsToSelector: selector]) {
216
+
217
+ return [self .delegate collectionViewTableLayoutManager: self
218
+ collectionView: collectionView
219
+ shouldSelectItemAtRow: row
220
+ column: column
221
+ indexPath: indexPath];
222
+ }
223
+
224
+ return YES ;
209
225
}
210
226
211
227
@end
You can’t perform that action at this time.
0 commit comments