Skip to content
Browse files

Action sheet support added

  • Loading branch information...
1 parent b716391 commit f8474c78fe81a289db4aacae78407e567b547d08 @MugunthKumar committed Mar 22, 2011
View
22 UIActionSheet+MKBlockAdditions.h
@@ -13,4 +13,26 @@
}
++(void) actionSheetWithTitle:(NSString*) title
+ message:(NSString*) message
+ buttons:(NSArray*) buttonTitles
+ showInView:(UIView*) view
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled;
+
+
++ (void) alertViewWithTitle:(NSString*) title
+ message:(NSString*) message
+ destructiveButtonTitle:(NSString*) descructiveButtonTitle
+ buttons:(NSArray*) buttonTitles
+ showInView:(UIView*) view
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled;
+
+
++ (void) photoPickerAlertViewWithTitle:(NSString*) title
+ showInView:(UIView*) view
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled;
+
@end
View
31 UIActionSheet+MKBlockAdditions.m
@@ -12,4 +12,35 @@
@implementation UIActionSheet (MKBlockAdditions)
++(void) actionSheetWithTitle:(NSString*) title
+ message:(NSString*) message
+ buttons:(NSArray*) buttonTitles
+ showInView:(UIView*) view
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled
+{
+
+}
+
+
++ (void) alertViewWithTitle:(NSString*) title
+ message:(NSString*) message
+ destructiveButtonTitle:(NSString*) descructiveButtonTitle
+ buttons:(NSArray*) buttonTitles
+ showInView:(UIView*) view
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled
+{
+
+}
+
+
++ (void) photoPickerAlertViewWithTitle:(NSString*) title
+ showInView:(UIView*) view
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled
+{
+
+}
+
@end
View
6 UIAlertViewCategory/UIAlertView+MKBlockAdditions.h
@@ -21,10 +21,10 @@
cancelButtonTitle:(NSString*) cancelButtonTitle;
+ (void) alertViewWithTitle:(NSString*) title
- onDismiss:(DismissBlock) dismissed
- onCancel:(CancelBlock) cancelled
message:(NSString*) message
cancelButtonTitle:(NSString*) cancelButtonTitle
- otherButtonTitles:(NSArray*) otherButtons;
+ otherButtonTitles:(NSArray*) otherButtons
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled;
@end
View
4 UIAlertViewCategory/UIAlertView+MKBlockAdditions.m
@@ -14,11 +14,11 @@
@implementation UIAlertView (Block)
+ (void) alertViewWithTitle:(NSString*) title
- onDismiss:(DismissBlock) dismissed
- onCancel:(CancelBlock) cancelled
message:(NSString*) message
cancelButtonTitle:(NSString*) cancelButtonTitle
otherButtonTitles:(NSArray*) otherButtons
+ onDismiss:(DismissBlock) dismissed
+ onCancel:(CancelBlock) cancelled
{
[_cancelBlock release];
View
9 UIAlertViewCategory/UIAlertViewCategoryViewController.m
@@ -7,7 +7,7 @@
//
#import "UIAlertViewCategoryViewController.h"
-#import "UIAlertView+Block.h"
+#import "UIAlertView+MKBlockAdditions.h"
@implementation UIAlertViewCategoryViewController
@@ -32,6 +32,9 @@ - (void)viewDidLoad
{
[super viewDidLoad];
[UIAlertView alertViewWithTitle:@"Test"
+ message:@"Hello World"
+ cancelButtonTitle:@"Dismiss"
+ otherButtonTitles:[NSArray arrayWithObjects:@"First", @"Second", nil]
onDismiss:^(int buttonIndex)
{
NSLog(@"%d", buttonIndex);
@@ -40,9 +43,7 @@ - (void)viewDidLoad
{
NSLog(@"Cancelled");
}
- message:@"Hello World"
- cancelButtonTitle:@"Dismiss"
- otherButtonTitles:[NSArray arrayWithObjects:@"First", @"Second", nil]];
+ ];
}

0 comments on commit f8474c7

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