Navigation Menu

Skip to content

Commit

Permalink
Dismissal block is now called on any dismissal, not just button-less …
Browse files Browse the repository at this point in the history
…dismissals
  • Loading branch information
Jim Kubicek committed Feb 3, 2012
1 parent 737f097 commit e91ffa8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions UIActionSheet+Blocks.h
Expand Up @@ -15,8 +15,7 @@

- (NSInteger)addButtonItem:(RIButtonItem *)item;

/** This block is called when the action sheet is dismssed for any reason other than a button
press. If the user taps outside the view, for example.
/** This block is called when the action sheet is dismssed for any reason.
*/
@property (copy, nonatomic) RISimpleAction dismissalAction;

Expand Down
7 changes: 3 additions & 4 deletions UIActionSheet+Blocks.m
Expand Up @@ -89,10 +89,9 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
if(item.action)
item.action();
}
else if (self.dismissalAction)
{
self.dismissalAction();
}

if (self.dismissalAction) self.dismissalAction();

objc_setAssociatedObject(self, (__bridge const void *)RI_BUTTON_ASS_KEY, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(self, (__bridge const void *)RI_DISMISSAL_ACTION_KEY, nil, OBJC_ASSOCIATION_COPY);
}
Expand Down

0 comments on commit e91ffa8

Please sign in to comment.