Skip to content

Commit

Permalink
Fixed crash on iPad when try to share a photo (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
RodolfoGS authored Jul 26, 2020
1 parent 6dcf125 commit 23690b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ios/MerryPhotoView.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,13 @@ - (BOOL)photosViewController:(NYTPhotosViewController*)photosViewController capt
}
- (void)displayActivityViewController:(UIActivityViewController*)controller animated:(BOOL)animated
{

[[self getRootView] presentViewController:controller animated:animated completion:nil];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[[self getRootView] presentViewController:controller animated:animated completion:nil];
}
else {
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:controller];
[popup presentPopoverFromRect:CGRectMake([self getRootView].view.frame.size.width/2, [self getRootView].view.frame.size.height/2, 0, 0)inView:[self getRootView].view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
- (BOOL)photosViewController:(NYTPhotosViewController*)photosViewController handleLongPressForPhoto:(id<NYTPhoto>)photo withGestureRecognizer:(UILongPressGestureRecognizer*)longPressGestureRecognizer
{
Expand Down

0 comments on commit 23690b5

Please sign in to comment.