Commit 8238f3f3 authored by Felix Paul Kühne's avatar Felix Paul Kühne

sharing: fix exception when touch the share button on iPad on iOS 8 (closes #13419)

parent 0cd909a8
......@@ -31,6 +31,8 @@
#define SYSTEM_RUNS_IOS7_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
#define SYSTEM_RUNS_IOS8_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")
#ifndef NDEBUG
#define APLog(format, ...) NSLog(format, ## __VA_ARGS__)
#else
......
......@@ -1337,7 +1337,6 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
else
indexPaths = [self.tableView indexPathsForSelectedRows];
NSUInteger count = indexPaths.count;
if (count) {
NSMutableArray /* NSURL */ *fileURLobjects = [[NSMutableArray alloc] initWithCapacity:count];
......@@ -1392,6 +1391,9 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
};
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:fileURLobjects applicationActivities:@[_openInActivity]];
if (SYSTEM_RUNS_IOS8_OR_LATER)
controller.popoverPresentationController.sourceView = self.navigationController.toolbar;
controller.completionHandler = ^(NSString *activityType, BOOL completed) {
APLog(@"UIActivityViewController finished with activity type: %@, completed: %i", activityType, completed);
......@@ -1411,7 +1413,6 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
// Just in case, we could call enableInteractionBlock here. Since we are disabling touch interaction for the entire UI, to be safe that we return to the proper state: re-enable everything (if presentViewController:animated:completion: failed for some reason). But UIApplication gives us a warning even if we check isIgnoringInteractionEvents, so do not call it for now.
// enableInteractionBlock();
};
[self.navigationController presentViewController:controller animated:YES completion:enableInteractionBlock];
});
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment