我想拿出带有 AirDrop 的共享表作为我的应用程序中的唯一选项。
在 iOS 7 中,我可以简单地将所有共享类型添加到( , , ...)excludedActivityTypes的属性中UIActivityViewControllerUIActivityTypeMessageUIActivityTypeMail
但现在在 iOS 8 中,通过应用程序扩展,用户可能会出现额外的共享提供程序。有没有办法只显示AirDrop ?
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL URLWithString:url]]
applicationActivities:nil];
NSArray *excludedActivities = @[UIActivityTypePostToTwitter, UIActivityTypePostToFacebook,
UIActivityTypePostToWeibo,
UIActivityTypeMessage, UIActivityTypeMail,
UIActivityTypePrint, UIActivityTypeCopyToPasteboard,
UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList, UIActivityTypePostToFlickr,
UIActivityTypePostToVimeo, UIActivityTypePostToTencentWeibo];
Run Code Online (Sandbox Code Playgroud)