我之前尝试过使用这篇文章中的答案 -
How to exclude Notes and Reminders apps from the UIActivityViewController?
但他们都没有为我工作。 有谁知道在iOS 10中是否有删除它们的选项? 或者更好的解决方案,适用于iOS 9? 感谢
答案 0 :(得分:0)
这对我有用......
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];