0

I tried before using the answers in this post -

How to exclude Notes and Reminders apps from the UIActivityViewController?

But none of them worked for me. Does anyone know if there is an options to remove them in iOS 10? or a better solution that will work for me in iOS 9 ? thanks

Community
  • 1
  • 1
user2993422
  • 306
  • 2
  • 6
  • 22

1 Answers1

0

This works for me...

NSString *text = @"XYZ";
UIImage *image = [UIImage imageNamed:@"ABC"];
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[text, image] applicationActivities:nil];

controller.excludedActivityTypes = @[UIActivityTypePostToWeibo,
                                     UIActivityTypeMail,
                                     UIActivityTypePrint,
                                     UIActivityTypeCopyToPasteboard,
                                     UIActivityTypeAssignToContact,
                                     UIActivityTypeSaveToCameraRoll,
                                     UIActivityTypeAddToReadingList,
                                     UIActivityTypePostToFlickr,
                                     UIActivityTypePostToVimeo,
                                     UIActivityTypePostToTencentWeibo,
                                     UIActivityTypeAirDrop,
                                     UIActivityTypeOpenInIBooks,
                                     @"com.apple.mobilenotes.SharingExtension",
                                     @"com.apple.reminders.RemindersEditorExtension"];

[self presentViewController:controller animated:YES completion:nil];
Martin Evans
  • 45,791
  • 17
  • 81
  • 97
Asif Raza
  • 836
  • 12
  • 29