mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Rename layoutDelegate to layoutInspector in ASCollectionView
This commit is contained in:
@@ -90,7 +90,7 @@
|
|||||||
* collection view layout subclasses will need to provide their own implementation of an inspector object for their
|
* collection view layout subclasses will need to provide their own implementation of an inspector object for their
|
||||||
* supplementary views to be compatible with `ASCollectionView`'s supplementary node support.
|
* supplementary views to be compatible with `ASCollectionView`'s supplementary node support.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, weak) id<ASCollectionViewLayoutInspecting> layoutDelegate;
|
@property (nonatomic, weak) id<ASCollectionViewLayoutInspecting> layoutInspector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread.
|
* Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread.
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
// Register the default layout inspector delegate for flow layouts only, custom layouts
|
// Register the default layout inspector delegate for flow layouts only, custom layouts
|
||||||
// will need to roll their own ASCollectionViewLayoutInspecting implementation and set a layout delegate
|
// will need to roll their own ASCollectionViewLayoutInspecting implementation and set a layout delegate
|
||||||
if ([layout asdk_isFlowLayout]) {
|
if ([layout asdk_isFlowLayout]) {
|
||||||
_layoutDelegate = [self flowLayoutInspector];
|
_layoutInspector = [self flowLayoutInspector];
|
||||||
}
|
}
|
||||||
|
|
||||||
_registeredSupplementaryKinds = [NSMutableSet set];
|
_registeredSupplementaryKinds = [NSMutableSet set];
|
||||||
@@ -341,7 +341,7 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
[super setCollectionViewLayout:collectionViewLayout];
|
[super setCollectionViewLayout:collectionViewLayout];
|
||||||
if ([collectionViewLayout asdk_isFlowLayout]) {
|
if ([collectionViewLayout asdk_isFlowLayout]) {
|
||||||
_flowLayoutInspector = nil;
|
_flowLayoutInspector = nil;
|
||||||
_layoutDelegate = [self flowLayoutInspector];
|
_layoutInspector = [self flowLayoutInspector];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,20 +750,20 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
|
|
||||||
- (ASSizeRange)dataController:(ASCollectionDataController *)dataController constrainedSizeForSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
|
- (ASSizeRange)dataController:(ASCollectionDataController *)dataController constrainedSizeForSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssert(_layoutDelegate != nil, @"To support supplementary nodes in ASCollectionView, it must have a layoutDelegate for layout inspection. (See ASCollectionViewFlowLayoutInspector for an example.)");
|
ASDisplayNodeAssert(_layoutInspector != nil, @"To support supplementary nodes in ASCollectionView, it must have a layoutDelegate for layout inspection. (See ASCollectionViewFlowLayoutInspector for an example.)");
|
||||||
return [_layoutDelegate collectionView:self constrainedSizeForSupplementaryNodeOfKind:kind atIndexPath:indexPath];
|
return [_layoutInspector collectionView:self constrainedSizeForSupplementaryNodeOfKind:kind atIndexPath:indexPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUInteger)dataController:(ASCollectionDataController *)dataController supplementaryNodesOfKind:(NSString *)kind inSection:(NSUInteger)section
|
- (NSUInteger)dataController:(ASCollectionDataController *)dataController supplementaryNodesOfKind:(NSString *)kind inSection:(NSUInteger)section
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssert(_layoutDelegate != nil, @"To support supplementary nodes in ASCollectionView, it must have a layoutDelegate for layout inspection. (See ASCollectionViewFlowLayoutInspector for an example.)");
|
ASDisplayNodeAssert(_layoutInspector != nil, @"To support supplementary nodes in ASCollectionView, it must have a layoutDelegate for layout inspection. (See ASCollectionViewFlowLayoutInspector for an example.)");
|
||||||
return [_layoutDelegate collectionView:self supplementaryNodesOfKind:kind inSection:section];
|
return [_layoutInspector collectionView:self supplementaryNodesOfKind:kind inSection:section];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUInteger)dataController:(ASCollectionDataController *)dataController numberOfSectionsForSupplementaryNodeOfKind:(NSString *)kind;
|
- (NSUInteger)dataController:(ASCollectionDataController *)dataController numberOfSectionsForSupplementaryNodeOfKind:(NSString *)kind;
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssert(_layoutDelegate != nil, @"To support supplementary nodes in ASCollectionView, it must have a layoutDelegate for layout inspection. (See ASCollectionViewFlowLayoutInspector for an example.)");
|
ASDisplayNodeAssert(_layoutInspector != nil, @"To support supplementary nodes in ASCollectionView, it must have a layoutDelegate for layout inspection. (See ASCollectionViewFlowLayoutInspector for an example.)");
|
||||||
return [_layoutDelegate collectionView:self numberOfSectionsForSupplementaryNodeOfKind:kind];
|
return [_layoutInspector collectionView:self numberOfSectionsForSupplementaryNodeOfKind:kind];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - ASRangeControllerDelegate.
|
#pragma mark - ASRangeControllerDelegate.
|
||||||
|
|||||||
Reference in New Issue
Block a user