@@ -57,7 +57,9 @@ typedef NS_ENUM(NSUInteger, ASCollectionViewInvalidationStyle) {
5757};
5858
5959static const NSUInteger kASCollectionViewAnimationNone = UITableViewRowAnimationNone;
60- static NSString * const kCellReuseIdentifier = @" _ASCollectionViewCell" ;
60+
61+ // / Used for all cells and supplementaries. UICV keys by supp-kind+reuseID so this is plenty.
62+ static NSString * const kReuseIdentifier = @" _ASCollectionReuseIdentifier" ;
6163
6264#pragma mark -
6365#pragma mark ASCellNode<->UICollectionViewCell bridging.
@@ -338,7 +340,7 @@ - (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionV
338340 _cellsForVisibilityUpdates = [NSMutableSet set ];
339341 self.backgroundColor = [UIColor whiteColor ];
340342
341- [self registerClass: [_ASCollectionViewCell class ] forCellWithReuseIdentifier: kCellReuseIdentifier ];
343+ [self registerClass: [_ASCollectionViewCell class ] forCellWithReuseIdentifier: kReuseIdentifier ];
342344
343345 if (!AS_AT_LEAST_IOS9) {
344346 _retainedLayer = self.layer ;
@@ -780,8 +782,7 @@ - (void)registerSupplementaryNodeOfKind:(NSString *)elementKind
780782{
781783 ASDisplayNodeAssert (elementKind != nil , @" A kind is needed for supplementary node registration" );
782784 [_registeredSupplementaryKinds addObject: elementKind];
783- [self registerClass: [UICollectionReusableView class ] forSupplementaryViewOfKind: elementKind
784- withReuseIdentifier: [self __reuseIdentifierForKind: elementKind]];
785+ [self registerClass: [UICollectionReusableView class ] forSupplementaryViewOfKind: elementKind withReuseIdentifier: kReuseIdentifier ];
785786}
786787
787788- (void )insertSections : (NSIndexSet *)sections
@@ -844,11 +845,6 @@ - (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)
844845 [_dataController moveRowAtIndexPath: indexPath toIndexPath: newIndexPath withAnimationOptions: kASCollectionViewAnimationNone ];
845846}
846847
847- - (NSString *)__reuseIdentifierForKind : (NSString *)kind
848- {
849- return [@" _ASCollectionSupplementaryView_" stringByAppendingString: kind];
850- }
851-
852848#pragma mark -
853849#pragma mark Intercepted selectors.
854850
@@ -870,8 +866,7 @@ - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollection
870866
871867- (UICollectionReusableView *)collectionView : (UICollectionView *)collectionView viewForSupplementaryElementOfKind : (NSString *)kind atIndexPath : (NSIndexPath *)indexPath
872868{
873- NSString *identifier = [self __reuseIdentifierForKind: kind];
874- UICollectionReusableView *view = [self dequeueReusableSupplementaryViewOfKind: kind withReuseIdentifier: identifier forIndexPath: indexPath];
869+ UICollectionReusableView *view = [self dequeueReusableSupplementaryViewOfKind: kind withReuseIdentifier: kReuseIdentifier forIndexPath: indexPath];
875870 ASCellNode *node = [_dataController supplementaryNodeOfKind: kind atIndexPath: indexPath];
876871 ASDisplayNodeAssert (node != nil , @" Supplementary node should exist. Kind = %@ , indexPath = %@ , collectionDataSource = %@ " , kind, indexPath, self);
877872 [_rangeController configureContentView: view forCellNode: node];
@@ -882,7 +877,7 @@ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
882877
883878- (UICollectionViewCell *)collectionView : (UICollectionView *)collectionView cellForItemAtIndexPath : (NSIndexPath *)indexPath
884879{
885- _ASCollectionViewCell *cell = [self dequeueReusableCellWithReuseIdentifier: kCellReuseIdentifier forIndexPath: indexPath];
880+ _ASCollectionViewCell *cell = [self dequeueReusableCellWithReuseIdentifier: kReuseIdentifier forIndexPath: indexPath];
886881
887882 ASCellNode *node = [self nodeForItemAtIndexPath: indexPath];
888883 cell.node = node;
0 commit comments