Created
October 31, 2014 11:23
-
-
Save spraveenk91/bdf26607f363c8535042 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@protocol BaseDelegate <NSObject> | |
@required | |
- (void)didSelectActionSheetIndex:(NSString *)actionTitle actionSheetIndex:(NSInteger )index; | |
@end | |
@interface CustomAction : NSObject <UIActionSheetDelegate> | |
@property (nonatomic, assign) id<BaseDelegate> delegate; // Assign property | |
@end | |
-------------- | |
@interface FirstViewController () <BaseDelegate, ActionDelegate> | |
@property (nonatomic, assign) NSInteger currentSelection; | |
@property (nonatomic, strong) CustomAction *actionObj; | |
@end | |
@implementation FirstViewController | |
@synthesize currentSelection, actionObj; | |
... | |
... | |
- (void)cellMenuClicked:(id)sender { | |
// CustomAction *obj = [[CustomAction alloc] init]; | |
NSLog(@"Proto - %@", actionObj); | |
actionObj.delegate = self; | |
thumbActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:actionObj cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Add to Watchlist", @"Share", nil]; | |
[thumbActionSheet showInView:[self.view window]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment