Skip to content

Commit

Permalink
Support iPad for iOS8 +
Browse files Browse the repository at this point in the history
  • Loading branch information
treacher committed Nov 25, 2015
1 parent 0d6b592 commit d20a427
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Assets/Plugins/iOS/FrispSocial/FrispSocial.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ - (void) share:(NSString *)text media:(NSString *)media {
UIImage *image = [[UIImage alloc] initWithData:imageData];

socialViewController = [[UIActivityViewController alloc] initWithActivityItems:@[text, image] applicationActivities:nil];

UIViewController *rootViewController = UnityGetGLViewController();

[rootViewController presentViewController:socialViewController animated:YES completion:nil];

if ([socialViewController respondsToSelector:@selector(popoverPresentationController)]) {
// IOS8 iPad
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:socialViewController];
[popup presentPopoverFromRect:CGRectMake(rootViewController.view.frame.size.width/2, rootViewController.view.frame.size.height/4, 0, 0)inView:rootViewController.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
} else {
[rootViewController presentViewController:socialViewController animated:YES completion:nil];
}
}

extern "C" {
Expand Down

0 comments on commit d20a427

Please sign in to comment.