-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project broken in iOS 9 #19
Comments
Just do a typecast to UICollectionViewLayoutAttributes where it complains about indexPath: Example row 67: Replace return [itemsIndexPathsInVisibleRectSet containsObject:
[[[behaviour items] firstObject] indexPath]] == NO;
With the following return [itemsIndexPathsInVisibleRectSet containsObject:
[((UICollectionViewLayoutAttributes *)[[behaviour items] firstObject]) indexPath]] == NO; |
Works for me. Should this issue be closed? |
There's a pull request open since June 10 fixing this issue |
I think it is caused by the new generic feature // Step 1: Remove any behaviours that are no longer visible.
NSArray *noLongerVisibleBehaviours = [self.dynamicAnimator.behaviors filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UIAttachmentBehavior *behaviour, NSDictionary *bindings) {
UICollectionViewLayoutAttributes *layoutAttr =
(UICollectionViewLayoutAttributes *)(behaviour.items.firstObject);
return [itemsIndexPathsInVisibleRectSet containsObject:layoutAttr.indexPath] == NO;
}]];
[noLongerVisibleBehaviours enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop) {
[self.dynamicAnimator removeBehavior:obj];
UICollectionViewLayoutAttributes *layoutAttr =
(UICollectionViewLayoutAttributes *)(((UIAttachmentBehavior *)obj).items.firstObject);
NSIndexPath *indexPathNeedToRemove = layoutAttr.indexPath;
[self.visibleIndexPathsSet removeObject:indexPathNeedToRemove];
[self.visibleHeaderAndFooterSet removeObject:indexPathNeedToRemove];
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just for the record,
UIAttachmentBehavior
does not respond to indexPath.When trying to build I'm getting:
"No known instance method for selector
indexPath
" compiler errors.(maybe you know a way to go around this issue)
The text was updated successfully, but these errors were encountered: