Last active
December 28, 2015 05:19
-
-
Save henneonrails/7449483 to your computer and use it in GitHub Desktop.
UIActivityViewController presentation on an iPad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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