GettingStarted
GettingStarted

Reputation: 7605

How can I share a secret line of text with UIActivityView

NSString* text=@"Hello world";
NSURL *myWebsite = [NSURL URLWithString:@"http://www.website.com/"];
//  UIImage * myImage =[UIImage imageNamed:@"myImage.png"];
NSArray* sharedObjects=@[text,myWebsite];
UIActivityViewController * activityViewController=[[UIActivityViewController alloc]initWithActivityItems:sharedObjects applicationActivities:nil];

activityViewController.popoverPresentationController.sourceView = self.view;
[self presentViewController:activityViewController animated:YES completion:nil];

I want to add an extra line of advertised text only after the Post button is pressed. I want to say "Made with NameOfApp"

Upvotes: 0

Views: 48

Answers (1)

Chris Droukas
Chris Droukas

Reputation: 3196

You can't do that. You cannot alter the contents of a UIActivityView after instantiating and presenting it. The most details you'll receive from this UIActivityView's completion handler is whether the activity successfully completed or not. You will not have an opportunity to silently alter the message.

If it's important to include the name of your application, include it by default. Users will either leave it in or delete it.

Upvotes: 1

Related Questions