mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Cleanup setup of default flow layout inspector
This commit is contained in:
@@ -205,10 +205,6 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
_dataController.delegate = _rangeController;
|
_dataController.delegate = _rangeController;
|
||||||
_dataController.dataSource = self;
|
_dataController.dataSource = self;
|
||||||
|
|
||||||
_flowLayoutInspector = [[ASCollectionViewFlowLayoutInspector alloc] init];
|
|
||||||
// TODO: Implement a better path of falling-back to a flow layout
|
|
||||||
_flowLayoutInspector.layout = (UICollectionViewFlowLayout *)layout;
|
|
||||||
|
|
||||||
_batchContext = [[ASBatchContext alloc] init];
|
_batchContext = [[ASBatchContext alloc] init];
|
||||||
|
|
||||||
_leadingScreensForBatching = 1.0;
|
_leadingScreensForBatching = 1.0;
|
||||||
@@ -228,6 +224,15 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
// and should not trigger a relayout.
|
// and should not trigger a relayout.
|
||||||
_ignoreMaxSizeChange = CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, CGSizeZero);
|
_ignoreMaxSizeChange = CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, CGSizeZero);
|
||||||
|
|
||||||
|
// Register the default layout inspector delegate for flow layouts, custom layouts
|
||||||
|
// will need to roll their own ASCollectionViewLayoutInspecting implementation.
|
||||||
|
if ([layout asdk_isFlowLayout]) {
|
||||||
|
_flowLayoutInspector = [[ASCollectionViewFlowLayoutInspector alloc] init];
|
||||||
|
_flowLayoutInspector.layout = (UICollectionViewFlowLayout *)layout;
|
||||||
|
_flowLayoutInspector.collectionView = self;
|
||||||
|
_layoutDelegate = _flowLayoutInspector;
|
||||||
|
}
|
||||||
|
|
||||||
self.backgroundColor = [UIColor whiteColor];
|
self.backgroundColor = [UIColor whiteColor];
|
||||||
|
|
||||||
[self registerClass:[_ASCollectionViewCell class] forCellWithReuseIdentifier:@"_ASCollectionViewCell"];
|
[self registerClass:[_ASCollectionViewCell class] forCellWithReuseIdentifier:@"_ASCollectionViewCell"];
|
||||||
|
|||||||
Reference in New Issue
Block a user