mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-24 01:38:26 +00:00
Remove iOS 7 UICollectionView delegate API support
Summary: Don't need support for iOS 7 anymore, save some cycles on layout. Reviewed By: ocrickard Differential Revision: D4098229 fbshipit-source-id: eeaaf875acda1229f9622f11acc7c77ccad75cf0
This commit is contained in:
parent
e4a47193c1
commit
9e8ad9626a
1 changed files with 0 additions and 21 deletions
|
|
@ -9,21 +9,11 @@
|
|||
|
||||
#import "IGListCollectionView.h"
|
||||
|
||||
@interface IGListCollectionView ()
|
||||
|
||||
@property (nonatomic, assign, readonly) BOOL requiresManualWillDisplay;
|
||||
@property (nonatomic, strong) NSSet *ig_visibleIndexPaths;
|
||||
|
||||
@end
|
||||
|
||||
@implementation IGListCollectionView
|
||||
|
||||
- (void)commonInit {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
self.alwaysBounceVertical = YES;
|
||||
|
||||
// iOS 6 and 7 do not support -collectionView:willDisplayCell:forItemAtIndexPath: so we do it ourselves
|
||||
_requiresManualWillDisplay = [[[UIDevice currentDevice] systemVersion] floatValue] < 8.0;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout {
|
||||
|
|
@ -49,17 +39,6 @@
|
|||
[UIView performWithoutAnimation:^{
|
||||
[super layoutSubviews];
|
||||
}];
|
||||
|
||||
if (self.requiresManualWillDisplay && [self.delegate respondsToSelector:@selector(collectionView:willDisplayCell:forItemAtIndexPath:)]) {
|
||||
NSArray *indexPaths = [self indexPathsForVisibleItems];
|
||||
for (NSIndexPath *path in indexPaths) {
|
||||
if (![self.ig_visibleIndexPaths containsObject:path]) {
|
||||
UICollectionViewCell *cell = [self cellForItemAtIndexPath:path];
|
||||
[self.delegate collectionView:self willDisplayCell:cell forItemAtIndexPath:path];
|
||||
}
|
||||
}
|
||||
self.ig_visibleIndexPaths = [NSSet setWithArray:indexPaths];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Reference in a new issue