Skip to content
Browse files

Add custom delete block to grid cell.

  • Loading branch information...
1 parent a2bce97 commit f2363bca774fed2f14c07a4fdee96a54609b6915 @luosheng luosheng committed Dec 26, 2011
Showing with 6 additions and 1 deletion.
  1. +1 −0 GMGridView/API/GMGridViewCell+Extended.h
  2. +5 −1 GMGridView/API/GMGridViewCell.m
View
1 GMGridView/API/GMGridViewCell+Extended.h
@@ -51,6 +51,7 @@ typedef void (^GMGridViewCellDeleteBlock)(GMGridViewCell*);
@property (nonatomic, getter=isEditing) BOOL editing;
@property (nonatomic, copy) GMGridViewCellDeleteBlock deleteBlock;
+@property (nonatomic, copy) GMGridViewCellDeleteBlock customDeleteBlock;
@property (nonatomic, assign) UIViewAutoresizing defaultFullsizeViewResizingMask;
@property (nonatomic, gm_weak) UIButton *deleteButton;
View
6 GMGridView/API/GMGridViewCell.m
@@ -56,6 +56,7 @@ @implementation GMGridViewCell
@synthesize defaultFullsizeViewResizingMask = _defaultFullsizeViewResizingMask;
@synthesize deleteButton = _deleteButton;
@synthesize deleteBlock = _deleteBlock;
+@synthesize customDeleteBlock = _customDeleteBlock;
@synthesize deleteButtonIcon = _deleteButtonIcon;
@synthesize deleteButtonOffset;
@@ -231,7 +232,10 @@ - (UIImage *)deleteButtonIcon
- (void)actionDelete
{
- if (self.deleteBlock)
+ if (self.customDeleteBlock)
+ {
+ self.customDeleteBlock(self);
+ } else if (self.deleteBlock)
{
self.deleteBlock(self);
}

0 comments on commit f2363bc

Please sign in to comment.
Something went wrong with that request. Please try again.