Skip to content

Instantly share code, notes, and snippets.

@henneonrails
Last active December 28, 2015 05:19
Show Gist options
  • Save henneonrails/7449483 to your computer and use it in GitHub Desktop.
Save henneonrails/7449483 to your computer and use it in GitHub Desktop.
UIActivityViewController presentation on an iPad
-(IBAction)Actions:(UIBarButtonItem*)sender
{
if ([activityPopover isPopoverVisible] == YES)
{
[activityPopover dismissPopoverAnimated:YES];
return;
}
UIActivityViewController *sharing = [[UIActivityViewController alloc] initWithActivityItems:[NSArray arrayWithObject:currentURL] applicationActivities:@[bookmarkActivity]];
activityPopover = [[UIPopoverController alloc] initWithContentViewController:sharing];
[activityPopover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
//you have to create a UIPopoverController (activityPopover) first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment