Created
March 22, 2012 16:18
-
-
Save reddavis/2159293 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "RDActionSheet.h" | |
@interface RDViewController : UIViewController <RDActionSheetDelegate> | |
@property (nonatomic, strong) IBOutlet UIButton *showActionSheetButton; | |
- (IBAction)showActionSheet:(id)sender; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation RDViewController | |
@synthesize showActionSheetButton; | |
#pragma mark - View management | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
- (void)viewDidUnload { | |
[super viewDidUnload]; | |
// Release any retained subviews of the main view. | |
} | |
#pragma mark - Show action sheet action | |
- (IBAction)showActionSheet:(id)sender { | |
RDActionSheet *actionSheet = [[RDActionSheet alloc] initWithCancelButtonTitle:@"Cancel" primaryButtonTitle:@"Save" destroyButtonTitle:@"Destroy" otherButtonTitles:@"Email", @"Tweet", nil]; | |
actionSheet.delegate = self; | |
[actionSheet showFrom:self.view]; | |
} | |
#pragma mark - RDActionSheetDelegate | |
- (void)actionSheet:(RDActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { | |
NSLog(@"Pressed %i", buttonIndex); | |
} | |
- (void)actionSheetDidBecomeCancelled:(RDActionSheet *)actionSheet { | |
NSLog(@"ActionSheet cancelled"); | |
} | |
#pragma mark - | |
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | |
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment