lundi 2 février 2015

UIActivityViewController on iPad dismissing "modal view" in iOS 8

I have this wired problem with UIActivityViewController on iPad when dismissing it.


What I have is a MainViewController from which I present a view controller like so (modal view):



ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
[self presentViewController:self.readerViewController animated:YES completion:nil];


In the ReaderViewController's toolbar I have a UIButton to show UIActivityViewController for PDF sharing.


This is how I present the UIActivityViewController:



_activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[document.fileURL] applicationActivities:nil];
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:_activityViewController];
[popup presentPopoverFromRect:button.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];


When UIActivityViewController is presented it works as expected. It will dismiss if I press anywhere on the screen, also as expected. The problem is if I double tap somewhere on the screen, both the UIActivityViewController and ReaderViewController will be dismissed at the same time. Now, I want only UIActivityViewController to be dismissed not ReaderViewController.


Any solution for this ?


/Cheers




Aucun commentaire:

Enregistrer un commentaire