mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Allow ASCollectionView to register for supplementary container
This commit is contained in:
committed by
Levi McCallum
parent
4e32c075d4
commit
0d2332bd82
@@ -119,6 +119,8 @@
|
||||
*/
|
||||
- (void)reloadData;
|
||||
|
||||
- (void)registerSupplementaryViewOfKind:(NSString *)elementKind;
|
||||
|
||||
/**
|
||||
* Inserts one or more sections.
|
||||
*
|
||||
|
||||
@@ -379,6 +379,12 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
[self performBatchAnimated:YES updates:updates completion:completion];
|
||||
}
|
||||
|
||||
- (void)registerSupplementaryViewOfKind:(NSString *)elementKind
|
||||
{
|
||||
NSString *identifier = [NSString stringWithFormat:@"_ASCollectionSupplementaryView_%@", elementKind];
|
||||
[self registerClass:[UIView class] forSupplementaryViewOfKind:elementKind withReuseIdentifier:identifier];
|
||||
}
|
||||
|
||||
- (void)insertSections:(NSIndexSet *)sections
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
_collectionView.asyncDelegate = self;
|
||||
_collectionView.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
[_collectionView registerSupplementaryViewOfKind:UICollectionElementKindSectionHeader];
|
||||
[_collectionView registerSupplementaryViewOfKind:UICollectionElementKindSectionFooter];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user