Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finally fully fixes bottom pane page controller, speeds up big select…

…ions and fixes left/right in navbar
  • Loading branch information...
commit 190973a99dcae8ccad305b1660db58dea752a8fb 1 parent 29cb573
@pieteromvlee pieteromvlee authored
Showing with 12 additions and 5 deletions.
  1. +12 −5 BCCollectionView.m
View
17 BCCollectionView.m
@@ -125,15 +125,20 @@ - (void)delegateUpdateDeselectionForItemAtIndex:(NSUInteger)index
forItem:[contentArray objectAtIndex:index]];
}
+- (void)delegateCollectionViewSelectionDidChange
+{
+ if ([delegate respondsToSelector:@selector(collectionViewSelectionDidChange:)]) {
+ [[NSRunLoop currentRunLoop] cancelPerformSelector:@selector(collectionViewSelectionDidChange:) target:delegate argument:self];
+ [(id)delegate performSelector:@selector(collectionViewSelectionDidChange:) withObject:self afterDelay:0.0];
+ }
+}
+
- (void)delegateDidSelectItemAtIndex:(NSUInteger)index
{
if ([delegate respondsToSelector:@selector(collectionView:didSelectItem:withViewController:)])
[delegate collectionView:self
didSelectItem:[contentArray objectAtIndex:index]
withViewController:[self viewControllerForItemAtIndex:index]];
-
- if ([delegate respondsToSelector:@selector(collectionViewSelectionDidChange:)])
- [delegate collectionViewSelectionDidChange:self];
}
- (void)delegateDidDeselectItemAtIndex:(NSUInteger)index
@@ -143,8 +148,7 @@ - (void)delegateDidDeselectItemAtIndex:(NSUInteger)index
didDeselectItem:[contentArray objectAtIndex:index]
withViewController:[self viewControllerForItemAtIndex:index]];
- if ([delegate respondsToSelector:@selector(collectionViewSelectionDidChange:)])
- [delegate collectionViewSelectionDidChange:self];
+ [self delegateCollectionViewSelectionDidChange];
}
- (void)delegateViewControllerBecameInvisibleAtIndex:(NSUInteger)index
@@ -367,6 +371,8 @@ - (void)selectItemAtIndex:(NSUInteger)index inBulk:(BOOL)bulkSelecting
[selectionIndexes addIndex:index];
[self delegateUpdateSelectionForItemAtIndex:index];
[self delegateDidSelectItemAtIndex:index];
+ if (!bulkSelecting)
+ [self delegateCollectionViewSelectionDidChange];
if ([self shoulDrawSelections])
[self setNeedsDisplayInRect:[self rectOfItemAtIndex:index]];
}
@@ -381,6 +387,7 @@ - (void)selectItemsAtIndexes:(NSIndexSet *)indexes
[self selectItemAtIndex:idx inBulk:YES];
}];
lastSelectionIndex = [indexes firstIndex];
+ [self delegateCollectionViewSelectionDidChange];
}
- (void)deselectItemAtIndex:(NSUInteger)index
Please sign in to comment.
Something went wrong with that request. Please try again.