Skip to content

Commit

Permalink
Refactoring and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosproject committed Sep 29, 2014
1 parent 2cb89f6 commit 7060efe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Binary file not shown.
4 changes: 0 additions & 4 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
target 'PTAlertView', :exclusive => true do
pod "PTAlertView", :path => "../"
end

14 changes: 13 additions & 1 deletion Pod/Classes/UIAlertView+Blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@

@interface UIAlertView (Blocks) <UIAlertViewDelegate>

- (id)initWithTitle:(NSString *)title
/**
* Create an alert view with the block passed has parameter to handle confirm and cancel action
*
* @param title Title of the Alert View
* @param message A message to be dispayed
* @param confirmButtonTitle The title of the confirm button
* @param confirmBlock A block to be executed when success button is pressed
* @param cancelButtonTitle The title of the cancel button
* @param cancelBlock A bloc to be executed when cancel button is pressed
*
* @return A newly instantiated UIAlertView
*/
- (instancetype)initWithTitle:(NSString *)title
message:(NSString *)message
confirmButtonTitle:(NSString *)confirmButtonTitle
confirmButtonBlock:(void (^)())confirmBlock
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/UIAlertView+Blocks.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@implementation UIAlertView (Blocks)

- (id)initWithTitle:(NSString *)title message:(NSString *)message confirmButtonTitle:(NSString *)confirmButtonTitle confirmButtonBlock:(void (^)())confirmBlock cancelButtonTitle:(NSString *)cancelButtonTitle cancelButtonBlock:(void (^)())cancelBlock {
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message confirmButtonTitle:(NSString *)confirmButtonTitle confirmButtonBlock:(void (^)())confirmBlock cancelButtonTitle:(NSString *)cancelButtonTitle cancelButtonBlock:(void (^)())cancelBlock {

if (confirmBlock) {
objc_setAssociatedObject (self, "confirmBlockCallback", [confirmBlock copy], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
Expand Down

0 comments on commit 7060efe

Please sign in to comment.