Skip to content

Commit

Permalink
Add Action Sheet on Touch to Card
Browse files Browse the repository at this point in the history
  • Loading branch information
groundwater committed Jul 3, 2012
1 parent f495e6b commit 4f6d2e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Card Snap/Card.h
Expand Up @@ -8,6 +8,6 @@

#import <UIKit/UIKit.h>

@interface Card : UIViewController
@interface Card : UIViewController < UIActionSheetDelegate >

@end
18 changes: 18 additions & 0 deletions Card Snap/Card.m
Expand Up @@ -19,4 +19,22 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
return self;
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if (event.type==UIEventTypeTouches){
NSLog(@"Touched");

UIActionSheet *actionSheet =
[[UIActionSheet alloc] initWithTitle:@"Bob Smith"
delegate:self
cancelButtonTitle:@"Cancel Button"
destructiveButtonTitle:@"Destructive Button"
otherButtonTitles:@"Other Button 1", @"Other Button 2", nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackOpaque];
[actionSheet showInView:self.view.superview];

}
[super touchesBegan:touches withEvent:event];
}

@end

0 comments on commit 4f6d2e8

Please sign in to comment.