Permalink
Browse files

fixed issue with userInteractionDisabled Cells and updated Demo

  • Loading branch information...
1 parent c61fa14 commit 0cfda25f7352dbeb22855d8675ff39dcd1dd000b @messi messi committed Jul 11, 2012
@@ -183,6 +183,7 @@ - (void)loadCellsInRect:(CGRect)rect {
UIView *gridViewCell = [self.gridCells objectForKey:rectValue];
if (gridViewCell == nil) {
gridViewCell = [self.gridViewDelegate gridView:self viewForCellWithRect:rectOfValue index:index];
+ gridViewCell.userInteractionEnabled = YES;
[gridViewCell addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]];
[self.gridCells setObject:gridViewCell forKey:rectValue];
}
@@ -167,16 +167,15 @@ - (NSArray *)rectsForCellsInGridView:(NGVaryingGridView *)gridView {
}
- (UIView *)gridView:(NGVaryingGridView *)gridView viewForCellWithRect:(CGRect)rect index:(NSUInteger)index {
- NGTimeTableCell *cell = (NGTimeTableCell *) ([gridView dequeueReusableCell] ?: [[NGTimeTableCell alloc] initWithFrame:rect]);
- cell.frame = rect;
+ NGTimeTableCell *cell = (NGTimeTableCell *) ([gridView dequeueReusableCellWithFrame:rect] ?: [[NGTimeTableCell alloc] initWithFrame:rect]);
NSDictionary *event = [self.events objectAtIndex:index];
cell.text = [event objectForKey:@"title"];
return cell;
}
- (void)gridView:(NGVaryingGridView *)gridView didSelectCell:(UIView *)cell index:(NSUInteger)index {
-
+ NSLog(@"You selected a cell!");
}
- (void)gridView:(NGVaryingGridView *)gridView willPrepareCellForReuse:(UIView *)cell {

0 comments on commit 0cfda25

Please sign in to comment.