Remove an existing UIAlertViews when invalidating the RCTAlertManager

Reviewed By: @nicklockwood

Differential Revision: D2456795
This commit is contained in:
Dave Miller 2015-09-18 08:40:49 -07:00 committed by facebook-github-bot-3
parent f5409c1a51
commit 4af2501e8e
2 changed files with 9 additions and 1 deletions

View File

@ -10,7 +10,8 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "RCTBridgeModule.h" #import "RCTBridgeModule.h"
#import "RCTInvalidating.h"
@interface RCTAlertManager : NSObject <RCTBridgeModule> @interface RCTAlertManager : NSObject <RCTBridgeModule, RCTInvalidating>
@end @end

View File

@ -40,6 +40,13 @@ RCT_EXPORT_MODULE()
return dispatch_get_main_queue(); return dispatch_get_main_queue();
} }
- (void)invalidate
{
for (UIAlertView *alert in _alerts) {
[alert dismissWithClickedButtonIndex:0 animated:YES];
}
}
/** /**
* @param {NSDictionary} args Dictionary of the form * @param {NSDictionary} args Dictionary of the form
* *