Skip to content

Instantly share code, notes, and snippets.

@makzan
Created October 20, 2014 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makzan/83c0e48a4cb660787970 to your computer and use it in GitHub Desktop.
Save makzan/83c0e48a4cb660787970 to your computer and use it in GitHub Desktop.
Basic usage of UIActivityViewController
- (IBAction)shareAction:(id)sender {
NSString *title = [NSString stringWithFormat:@"I'm reading this great product: %@",self.titleLabel.text];
NSURL *url = [NSURL URLWithString:@"http://example.com"];
UIActivityViewController *actionController = [[UIActivityViewController alloc] initWithActivityItems:@[title, url] applicationActivities:nil];
[self.navigationController presentViewController:actionController animated:YES completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment