1

I'd like to create a UIActivityViewController with just the text and mail activities. How would I do this? The documentation seems to be fairly sparse in substance.

I'm using the following code to present my UIActivityViewController:

NSArray *Items   = [NSArray arrayWithObject:@"text"];

UIActivityViewController *ActivityView =
[[UIActivityViewController alloc]
 initWithActivityItems:Items applicationActivities:nil];
[self presentViewController:ActivityView animated:YES completion:nil];

Which produces this:

enter image description here

rmaddy
  • 307,833
  • 40
  • 508
  • 550
Apollo
  • 8,384
  • 30
  • 97
  • 186

1 Answers1

5

you need to set setExcludedActivityTypes like this:-

[ActivityView setExcludedActivityTypes:[NSArray arrayWithObjects:
                                               UIActivityTypeMail,UIActivityTypeCopyToPasteboard,nil]];
Nitin Gohel
  • 49,182
  • 17
  • 106
  • 143
  • also, I don't know if you noticed, but the message system icon doesn't appear. Is that just because I'm testing this on the iOS simulator? – Apollo Jul 31 '13 at 05:06
  • take a look this documentation http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIActivity_Class/Reference/Reference.html and also check this:- http://stackoverflow.com/questions/12606444/how-to-add-facebook-twitter-mail-message-icons-in-uiactivityviewcontroller – Nitin Gohel Jul 31 '13 at 05:11
  • Test app in Device as mention http://stackoverflow.com/questions/9910366/what-is-the-bundle-identifier-of-apples-default-applications-in-ios – Nitin Gohel Jul 31 '13 at 05:31