If you don't want to subclass UIActivityViewController
you can include them in your .excludedActivityTypes
when creating your UIActivityViewController
.
Objective C:
UIActivityViewController *activityController = [[UIActivityViewController alloc]initWithActivityItems:sharingItems applicationActivities:nil];
activityController.excludedActivityTypes = @[
UIActivityTypeAssignToContact,
UIActivityTypePrint,
UIActivityTypeAddToReadingList,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeOpenInIBooks,
@"com.apple.mobilenotes.SharingExtension",
@"com.apple.reminders.RemindersEditorExtension"
];
[self presentViewController:activityController animated:YES completion:nil];
Swift 4.2:
let activityController = UIActivityViewController(activityItems: sharingItems, applicationActivities: nil)
activityController.excludedActivityTypes = [
UIActivity.ActivityType.assignToContact,
UIActivity.ActivityType.print,
UIActivity.ActivityType.addToReadingList,
UIActivity.ActivityType.saveToCameraRoll,
UIActivity.ActivityType.openInIBooks,
UIActivity.ActivityType(rawValue: "com.apple.reminders.RemindersEditorExtension"),
UIActivity.ActivityType(rawValue: "com.apple.mobilenotes.SharingExtension")]
present(activityController, animated: true, completion: nil)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…