Permalink
Browse files

isDragging now returns YES if the KKGridView itself is dragging or an…

…y superview is dragging.
  • Loading branch information...
1 parent 8f828c8 commit da662f0591b9fca0484bd9e9b83e0797c923bbbc @tibr tibr committed Jun 11, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 KKGridView/KKGridView.m
View
@@ -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

0 comments on commit da662f0

Please sign in to comment.