UIActivityViewController to share text or images

//Elements to share NSString *textToShare = @"Something"; UIImage *imageToShare = self.img; NSArray *activityItems = @[textToShare, imageToShare]; //Create the object UIActivityViewController *shareController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil]; shareController.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypePrint, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo, UIActivityTypePostToFacebook]; //Show the view controller [self presentViewController: shareController animated:TRUE completion:nil];
This snippet is to share images or text from your app

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.