Commit 3ff1d841 authored by zhouteng's avatar zhouteng

set default share panel position

parent 23c89244
......@@ -25,7 +25,7 @@
NSNumber *originWidth = arguments[@"originWidth"];
NSNumber *originHeight = arguments[@"originHeight"];
CGRect originRect;
CGRect originRect = CGRectZero;
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
originRect = CGRectMake([originX doubleValue], [originY doubleValue],
[originWidth doubleValue], [originHeight doubleValue]);
......@@ -60,12 +60,15 @@
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:sharedItems applicationActivities:nil];
UIViewController *controller =[UIApplication sharedApplication].keyWindow.rootViewController;
activityViewController.popoverPresentationController.sourceView = controller.view;
if (!CGRectIsEmpty(origin)) {
activityViewController.popoverPresentationController.sourceRect = origin;
if (CGRectIsEmpty(origin)) {
origin = CGRectMake(0, 0, controller.view.bounds.size.width, controller.view.bounds.size.width /2);
}
activityViewController.popoverPresentationController.sourceRect = origin;
[activityViewController setValue:subject forKey:@"subject"];
[controller presentViewController:activityViewController animated:YES completion:nil];
}
......
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