我正试图在我的AirDrop应用程序中实现iOS特性。但是,我无法找到关于这个特性的任何特定教程或资源。有人能给我提供一个关于AirDrop 7中iOS特性实现的示例或链接吗?
任何帮助都是非常感谢的,谢谢。
发布于 2013-09-12 21:57:06
空投是一个功能,增加到目前可用的UIActivityViewController。如果用户在受支持的设备上有iOS7 (iPad mini,iPad 4,iPhone 5,iPhone 5c,iPhone 5s),那么空投应该可以作为另一种选择,除非您明确排除了该活动。
发布于 2013-09-20 07:02:23
试试这个,它内置的功能。在你的按钮选择器中这样做。
UIDocumentInteractionController *interaction = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:fileToTransferPath]];
//fileToTransferPath can be the path of a file supported by airdrop feature.
interaction.delegate = self;
[interaction presentOpenInMenuFromRect:sender.frame inView:self.view animated:NO];不要忘记在UIDocumentInteractionControllerDelegate文件中添加.h。
发布于 2013-09-19 22:44:18
假设您想要与某人共享一个URL。您可以使用UIActivityViewController这样做:
// Build a collection of activity items to share, in this case a url
NSArray *activityItems = @[[NSURL URLWithString:link]];
// Build a collection of custom activities (if you have any)
NSMutableArray *customActivities = [[NSMutableArray alloc] init];
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:customActivities];
[self presentViewController:activityController animated:YES completion:nil];这也会让您自动访问其他社交共享功能,除非您通过customActivities集合禁用它们。
https://stackoverflow.com/questions/18758637
复制相似问题