Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect {
}

- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewLayoutAttributes* currentItemAttributes = [[super layoutAttributesForItemAtIndexPath:indexPath] copy];
UICollectionViewLayoutAttributes* currentItemAttributes;

if (UIDevice.currentDevice.systemVersion.floatValue < 10.0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer if (@available(iOS 10, *)) { be used here.

However, are there any detrimental effects of using copy all the time? @petropavel13

Copy link
Author

@petropavel13 petropavel13 Jul 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!
Added available check.
There is no issues detected since december.

currentItemAttributes = [super layoutAttributesForItemAtIndexPath:indexPath];
} else {
currentItemAttributes = [[super layoutAttributesForItemAtIndexPath:indexPath] copy];
}

UIEdgeInsets sectionInset = [self evaluatedSectionInsetForItemAtIndex:indexPath.section];

BOOL isFirstItemInSection = indexPath.item == 0;
Expand Down