mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-13 07:39:37 +00:00
Use getter of layout inspector to create it lazily and not have to create it at initialization time
This commit is contained in:
parent
8b3ec83bfd
commit
ce98e56352
@ -253,9 +253,6 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
|
|
||||||
_layoutFacilitator = layoutFacilitator;
|
_layoutFacilitator = layoutFacilitator;
|
||||||
|
|
||||||
// Trigger creating the layout inspector
|
|
||||||
[self layoutInspector];
|
|
||||||
|
|
||||||
_proxyDelegate = [[ASCollectionViewProxy alloc] initWithTarget:nil interceptor:self];
|
_proxyDelegate = [[ASCollectionViewProxy alloc] initWithTarget:nil interceptor:self];
|
||||||
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
||||||
|
|
||||||
@ -371,7 +368,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
super.dataSource = (id<UICollectionViewDataSource>)_proxyDataSource;
|
super.dataSource = (id<UICollectionViewDataSource>)_proxyDataSource;
|
||||||
|
|
||||||
if (_layoutInspectorFlags.layoutInspectorDidChangeCollectionViewDataSource) {
|
if (_layoutInspectorFlags.layoutInspectorDidChangeCollectionViewDataSource) {
|
||||||
[_layoutInspector didChangeCollectionViewDataSource:asyncDataSource];
|
[self.layoutInspector didChangeCollectionViewDataSource:asyncDataSource];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +403,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
||||||
|
|
||||||
if (_layoutInspectorFlags.layoutInspectorDidChangeCollectionViewDelegate) {
|
if (_layoutInspectorFlags.layoutInspectorDidChangeCollectionViewDelegate) {
|
||||||
[_layoutInspector didChangeCollectionViewDelegate:asyncDelegate];
|
[self.layoutInspector didChangeCollectionViewDelegate:asyncDelegate];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -977,7 +974,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
|
|
||||||
- (ASSizeRange)dataController:(ASDataController *)dataController constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath
|
- (ASSizeRange)dataController:(ASDataController *)dataController constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
return [_layoutInspector collectionView:self constrainedSizeForNodeAtIndexPath:indexPath];
|
return [self.layoutInspector collectionView:self constrainedSizeForNodeAtIndexPath:indexPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUInteger)dataController:(ASDataController *)dataController rowsInSection:(NSUInteger)section
|
- (NSUInteger)dataController:(ASDataController *)dataController rowsInSection:(NSUInteger)section
|
||||||
@ -1017,17 +1014,17 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
|
|
||||||
- (ASSizeRange)dataController:(ASCollectionDataController *)dataController constrainedSizeForSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
|
- (ASSizeRange)dataController:(ASCollectionDataController *)dataController constrainedSizeForSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
return [_layoutInspector collectionView:self constrainedSizeForSupplementaryNodeOfKind:kind atIndexPath:indexPath];
|
return [self.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
|
||||||
{
|
{
|
||||||
return [_layoutInspector collectionView:self supplementaryNodesOfKind:kind inSection:section];
|
return [self.layoutInspector collectionView:self supplementaryNodesOfKind:kind inSection:section];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUInteger)dataController:(ASCollectionDataController *)dataController numberOfSectionsForSupplementaryNodeOfKind:(NSString *)kind;
|
- (NSUInteger)dataController:(ASCollectionDataController *)dataController numberOfSectionsForSupplementaryNodeOfKind:(NSString *)kind;
|
||||||
{
|
{
|
||||||
return [_layoutInspector collectionView:self numberOfSectionsForSupplementaryNodeOfKind:kind];
|
return [self.layoutInspector collectionView:self numberOfSectionsForSupplementaryNodeOfKind:kind];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - ASRangeControllerDataSource
|
#pragma mark - ASRangeControllerDataSource
|
||||||
|
Loading…
x
Reference in New Issue
Block a user