Skip to content

Commit

Permalink
Set barButtonItem on UIActivityViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
plu committed Aug 27, 2015
1 parent ad824eb commit 0af78a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Pod/Classes/ios/NYTPhotosViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ - (void)actionButtonTapped:(id)sender {

if (!clientDidHandle && self.currentlyDisplayedPhoto.image) {
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[self.currentlyDisplayedPhoto.image] applicationActivities:nil];
if ([activityViewController respondsToSelector:@selector(popoverPresentationController)]) {
activityViewController.popoverPresentationController.barButtonItem = sender;
}
activityViewController.completionHandler = ^(NSString *activityType, BOOL completed) {
if (completed && [self.delegate respondsToSelector:@selector(photosViewController:actionCompletedWithActivityType:)]) {
[self.delegate photosViewController:self actionCompletedWithActivityType:activityType];
Expand Down

0 comments on commit 0af78a5

Please sign in to comment.