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
  • 314,917
  • 42
  • 532
  • 579
Apollo
  • 8,874
  • 32
  • 104
  • 192

1 Answers1

5

you need to set setExcludedActivityTypes like this:-

[ActivityView setExcludedActivityTypes:[NSArray arrayWithObjects:
                                               UIActivityTypeMail,UIActivityTypeCopyToPasteboard,nil]];
Nitin Gohel
  • 49,482
  • 17
  • 105
  • 144
  • 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