Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dismissing iOS mail app opened from UIDocumentInteractionController removes the presenting ViewController's view in iOS7

I have implemented UIDocumentInteractionController in my app for showing open in options. It's working fine on iOS8 devices, but in iOS7 when I open my PDF in the mail from options. It opens mail composer when I dismiss the mail composer it also removes a menu button from my view (which is added to the window). I spent my whole day struggling with this issue but could not find any solution. When I open my PDF in other options, there is no issue. The issue is only with mail composer with iOS7. I know UIDocumentInterfaceController has issue with iOS7. I found the same issue on SO but this is with preview option of a quick look.

Here is my code to open options

[self.docInteractionController presentOptionsMenuFromRect:self.view.frame                                                    inView:self.view                                                  animated:YES]; 

Any help on this will be appreciated.

Thanks in advance.

like image 276
Mayank Jain Avatar asked Apr 16 '15 10:04

Mayank Jain


1 Answers

   - (IBAction)previewDocument:(id)sender {     NSURL *URL = [[NSBundle mainBundle] URLForResource:@"sample" withExtension:@"pdf"];      if (URL) {         // Initialize Document Interaction Controller         self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];          // Configure Document Interaction Controller         [self.documentInteractionController setDelegate:self];          // Preview PDF         [self.documentInteractionController presentPreviewAnimated:YES];     } } 
like image 135
Kamalkumar.E Avatar answered Oct 10 '22 10:10

Kamalkumar.E