Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface AlertViewCallback : NSObject <UIAlertViewDelegate>
- @property (copy, nonatomic) void (^callback)(void);
- @end
- @implementation AlertViewCallback
- + (instancetype)callback:(void (^)(void))callback {
- return [[self alloc] initWithCallback:callback];
- }
- - (instancetype)initWithCallback:(void (^)(void))callback {
- self = [super init];
- if (self) {
- self.callback = callback;
- }
- return self;
- }
- - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
- self.callback();
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement