Fixed display of alerts on top of modal window

Reviewed By: javache

Differential Revision: D2616170

fb-gh-sync-id: f72f728008099fff6fc966d7a2ce4c0d27a4fefd
This commit is contained in:
Nick Lockwood
2015-11-05 03:49:41 -08:00
committed by facebook-github-bot-5
parent 0da2004e88
commit 11df4cb08c
6 changed files with 29 additions and 22 deletions

View File

@@ -60,8 +60,7 @@ RCT_EXPORT_METHOD(openCameraDialog:(NSDictionary *)config
return;
}
UIWindow *keyWindow = RCTSharedApplication().keyWindow;
UIViewController *rootViewController = keyWindow.rootViewController;
UIViewController *rootViewController = RCTKeyWindow().rootViewController;
UIImagePickerController *imagePicker = [UIImagePickerController new];
imagePicker.delegate = self;
@@ -87,8 +86,7 @@ RCT_EXPORT_METHOD(openSelectDialog:(NSDictionary *)config
return;
}
UIWindow *keyWindow = RCTSharedApplication().keyWindow;
UIViewController *rootViewController = keyWindow.rootViewController;
UIViewController *rootViewController = RCTKeyWindow().rootViewController;
UIImagePickerController *imagePicker = [UIImagePickerController new];
imagePicker.delegate = self;
@@ -121,8 +119,7 @@ didFinishPickingMediaWithInfo:(NSDictionary *)info
[_pickerCallbacks removeObjectAtIndex:index];
[_pickerCancelCallbacks removeObjectAtIndex:index];
UIWindow *keyWindow = RCTSharedApplication().keyWindow;
UIViewController *rootViewController = keyWindow.rootViewController;
UIViewController *rootViewController = RCTKeyWindow().rootViewController;
[rootViewController dismissViewControllerAnimated:YES completion:nil];
callback(@[[info[UIImagePickerControllerReferenceURL] absoluteString]]);
@@ -137,8 +134,7 @@ didFinishPickingMediaWithInfo:(NSDictionary *)info
[_pickerCallbacks removeObjectAtIndex:index];
[_pickerCancelCallbacks removeObjectAtIndex:index];
UIWindow *keyWindow = RCTSharedApplication().keyWindow;
UIViewController *rootViewController = keyWindow.rootViewController;
UIViewController *rootViewController = RCTKeyWindow().rootViewController;
[rootViewController dismissViewControllerAnimated:YES completion:nil];
callback(@[]);