Presenting the UIDocumentPickerViewController and dismissing it keeps the presented view controller in freeze

436 Views Asked by At

How can I present the UIDocumentPickerViewController and dismissing it keeps the presented view controller in freeze

1

There are 1 best solutions below

0
On BEST ANSWER

Problem is that you open UIDocumentPickerViewController in PDFBrowserViewController so when you dismiss UIDocumentPickerViewController but PDFBrowserViewController was not dismissed.

solution 1: open UIDocumentPickerViewController directly in top viewcontroller without use of PDFBrowserViewController.

solution 2: after dismiss UIDocumentPickerViewController dismiss the parent controller in Delegate methods.

UIWindow *window = [[[UIApplication sharedApplication] windows] firstObject];
UIViewController *vc = [window rootViewController];
[vc dismissViewControllerAnimated:true completion:nil];