mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Make flow layout inspector call the new constrainedSize method (#2444)
This commit is contained in:
@@ -104,7 +104,8 @@ static inline ASSizeRange NodeConstrainedSizeForScrollDirection(ASCollectionView
|
||||
struct {
|
||||
unsigned int implementsReferenceSizeForHeader:1;
|
||||
unsigned int implementsReferenceSizeForFooter:1;
|
||||
unsigned int implementsConstrainedSizeForNodeAtIndexPath:1;
|
||||
unsigned int implementsConstrainedSizeForNodeAtIndexPathDeprecated:1;
|
||||
unsigned int implementsConstrainedSizeForItemAtIndexPath:1;
|
||||
} _delegateFlags;
|
||||
|
||||
struct {
|
||||
@@ -137,7 +138,8 @@ static inline ASSizeRange NodeConstrainedSizeForScrollDirection(ASCollectionView
|
||||
} else {
|
||||
_delegateFlags.implementsReferenceSizeForHeader = [delegate respondsToSelector:@selector(collectionView:layout:referenceSizeForHeaderInSection:)];
|
||||
_delegateFlags.implementsReferenceSizeForFooter = [delegate respondsToSelector:@selector(collectionView:layout:referenceSizeForFooterInSection:)];
|
||||
_delegateFlags.implementsConstrainedSizeForNodeAtIndexPath = [delegate respondsToSelector:@selector(collectionView:constrainedSizeForNodeAtIndexPath:)];
|
||||
_delegateFlags.implementsConstrainedSizeForNodeAtIndexPathDeprecated = [delegate respondsToSelector:@selector(collectionView:constrainedSizeForNodeAtIndexPath:)];
|
||||
_delegateFlags.implementsConstrainedSizeForItemAtIndexPath = [delegate respondsToSelector:@selector(collectionNode:constrainedSizeForItemAtIndexPath:)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +154,9 @@ static inline ASSizeRange NodeConstrainedSizeForScrollDirection(ASCollectionView
|
||||
|
||||
- (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (_delegateFlags.implementsConstrainedSizeForNodeAtIndexPath) {
|
||||
if (_delegateFlags.implementsConstrainedSizeForItemAtIndexPath) {
|
||||
return [collectionView.asyncDelegate collectionNode:collectionView.collectionNode constrainedSizeForItemAtIndexPath:indexPath];
|
||||
} else if (_delegateFlags.implementsConstrainedSizeForNodeAtIndexPathDeprecated) {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [collectionView.asyncDelegate collectionView:collectionView constrainedSizeForNodeAtIndexPath:indexPath];
|
||||
|
||||
Reference in New Issue
Block a user