Skip to content

Instantly share code, notes, and snippets.

@mluton
Created October 31, 2012 23:37
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mluton/3990658 to your computer and use it in GitHub Desktop.
Save mluton/3990658 to your computer and use it in GitHub Desktop.
Display UIActivityViewController in a Popover
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[@"something"] applicationActivities:nil];
self.popover = [[UIPopoverController alloc] initWithContentViewController:activityViewController];
self.popover.delegate = self;
[self.popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
@swlasse
Copy link

swlasse commented Feb 13, 2013

+1, thanks for this :)

I would like to add that if someone should be looking for an example of how to use this in a sample context, Apple provides a good sample project here: http://developer.apple.com/library/ios/#samplecode/Popovers/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010436

@raid5
Copy link

raid5 commented Jan 3, 2014

+1, thanks!

@OlesenkoViktor
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment