mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-24 01:38:26 +00:00
clarify assert message
Summary:
* Clarify assert message by adding item width/height
* Before: Width of item 1 in section 2 must be less than container 375 accounting for section insets {0, 0, 0, 0}
* After: Width of item 1 in section 2 (415 pt) must be less than or equal to container (375 pt) accounting for section insets {0, 0, 0, 0}
Reviewed By: rnystrom
Differential Revision: D6711829
fbshipit-source-id: be99e83fd68cd345cb6a05acdde27c8252e59650
This commit is contained in:
parent
82b52b2050
commit
a8275e08e1
1 changed files with 8 additions and 5 deletions
|
|
@ -492,11 +492,14 @@ static void adjustZIndexForAttributes(UICollectionViewLayoutAttributes *attribut
|
|||
const CGSize size = [delegate collectionView:collectionView layout:self sizeForItemAtIndexPath:indexPath];
|
||||
|
||||
IGAssert(CGSizeGetLengthInDirection(size, fixedDirection) <= paddedLengthInFixedDirection
|
||||
|| fabs(CGSizeGetLengthInDirection(size, fixedDirection) - paddedLengthInFixedDirection) < FLT_EPSILON,
|
||||
@"%@ of item %zi in section %zi must be less than container %.0f accounting for section insets %@",
|
||||
self.scrollDirection == UICollectionViewScrollDirectionVertical ? @"Width" : @"Height",
|
||||
item, section, CGRectGetLengthInDirection(contentInsetAdjustedCollectionViewBounds, fixedDirection),
|
||||
NSStringFromUIEdgeInsets(insets));
|
||||
|| fabs(CGSizeGetLengthInDirection(size, fixedDirection) - paddedLengthInFixedDirection) < FLT_EPSILON,
|
||||
@"%@ of item %zi in section %zi (%.0f pt) must be less than or equal to container (%.0f pt) accounting for section insets %@",
|
||||
self.scrollDirection == UICollectionViewScrollDirectionVertical ? @"Width" : @"Height",
|
||||
item,
|
||||
section,
|
||||
CGSizeGetLengthInDirection(size, fixedDirection),
|
||||
CGRectGetLengthInDirection(contentInsetAdjustedCollectionViewBounds, fixedDirection),
|
||||
NSStringFromUIEdgeInsets(insets));
|
||||
|
||||
CGFloat itemLengthInFixedDirection = MIN(CGSizeGetLengthInDirection(size, fixedDirection), paddedLengthInFixedDirection);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue