Skip to content

Commit

Permalink
Adding a cast for UICollectionViewLayoutAttributes. Fixing a build br…
Browse files Browse the repository at this point in the history
…eak for Xcode 7 related to stricter typing.
  • Loading branch information
yairsz committed Jun 10, 2015
1 parent 565d65e commit 1a8e850
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UICollectionView-Spring-Demo/TLSpringFlowLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ - (void)prepareLayout {

// Step 1: Remove any behaviours that are no longer visible.
NSArray *noLongerVisibleBehaviours = [self.dynamicAnimator.behaviors filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UIAttachmentBehavior *behaviour, NSDictionary *bindings) {
return [itemsIndexPathsInVisibleRectSet containsObject:[[[behaviour items] firstObject] indexPath]] == NO;
return [itemsIndexPathsInVisibleRectSet containsObject:[(UICollectionViewLayoutAttributes *)[[behaviour items] firstObject] indexPath]] == NO;
}]];

[noLongerVisibleBehaviours enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop) {
[self.dynamicAnimator removeBehavior:obj];
[self.visibleIndexPathsSet removeObject:[[[obj items] firstObject] indexPath]];
[self.visibleHeaderAndFooterSet removeObject:[[[obj items] firstObject] indexPath]];
[self.visibleIndexPathsSet removeObject:[(UICollectionViewLayoutAttributes *)[[obj items] firstObject] indexPath]];
[self.visibleHeaderAndFooterSet removeObject:[(UICollectionViewLayoutAttributes *)[[obj items] firstObject] indexPath]];
}];

// Step 2: Add any newly visible behaviours.
Expand Down

0 comments on commit 1a8e850

Please sign in to comment.