mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[ASCollectionNode] Add scrollableDirections method to ASCollectionViewLayoutInspecting p… (#2381)
* Add scrollableDirections method to ASCollectionViewLayoutInspecting protocol ASViewController's default method will not always return the correct scrollable directions in cases where size changes may not have been applied. This allows us to ignore this issue for a little while longer by allowing the layout inspector to explicitly vend this. * Better header, thanks @maicki!
This commit is contained in:
committed by
Michael Schneider
parent
3f11c67c82
commit
1d28639301
@@ -176,6 +176,11 @@ static inline ASSizeRange NodeConstrainedSizeForScrollDirection(ASCollectionView
|
||||
return [self layoutHasSupplementaryViewOfKind:kind inSection:section collectionView:collectionView] ? 1 : 0;
|
||||
}
|
||||
|
||||
- (ASScrollDirection)scrollableDirections
|
||||
{
|
||||
return (self.layout.scrollDirection == UICollectionViewScrollDirectionHorizontal) ? ASScrollDirectionHorizontalDirections : ASScrollDirectionVerticalDirections;
|
||||
}
|
||||
|
||||
#pragma mark - Private helpers
|
||||
|
||||
- (CGSize)sizeForSupplementaryViewOfKind:(NSString *)kind inSection:(NSUInteger)section collectionView:(ASCollectionView *)collectionView
|
||||
|
||||
Reference in New Issue
Block a user