Skip to content

Commit

Permalink
isDragging now returns YES if the KKGridView itself is dragging or an…
Browse files Browse the repository at this point in the history
…y superview is dragging.
  • Loading branch information
Tim Brückmann committed Jun 11, 2012
1 parent 8f828c8 commit da662f0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions KKGridView/KKGridView.m
Expand Up @@ -227,6 +227,25 @@ - (NSUInteger)selectedItemCount
return _selectedIndexPaths.count;
}

- (BOOL)isDragging
{
BOOL recursiveDragging = [super isDragging];
if (recursiveDragging == NO) {
UIView *superview = self.superview;
while (superview) {
if ([superview isKindOfClass:[UIScrollView class]]) {
UIScrollView *scrollView = (UIScrollView *)superview;
if (scrollView.isDragging) {
recursiveDragging = YES;
break;
}
}
superview = superview.superview;
}
}
return recursiveDragging;
}

#pragma mark - Setters

- (void)setAllowsMultipleSelection:(BOOL)allowsMultipleSelection
Expand Down

0 comments on commit da662f0

Please sign in to comment.