Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update RNFetchBlob.m
Solved an issue where the rootNavigationController is not necessarily the currently displayed controller, which caused an error of:
Warning: Attempt to present <SecondViewController: 0x7fb54b523240> on <ViewController: 0x7fb54b61e7f0> whose view is not in the window hierarchy!
  • Loading branch information
nadav2051 authored Aug 28, 2019
commit deb3588a36620e5efa9b1c2bc99ad4874c2e6ff8
7 changes: 6 additions & 1 deletion ios/RNFetchBlob/RNFetchBlob.m
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,12 @@ - (NSDictionary *)constantsToExport
- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller
{
UIWindow *window = [UIApplication sharedApplication].keyWindow;
return window.rootViewController;
UIViewController *currentlyPresentedView = [window.rootViewController presentedViewController];
if (currentlyPresentedView == nil)
{
return window.rootViewController;
}
return currentlyPresentedView;
}

# pragma mark - check expired network events
Expand Down