小编Tan*_*ain的帖子

通过UIDocumentInteractionController打开文件

UIDocumentInteractionController用于在我的应用程序中打开文档.我使用下面的方法预览PDF文件: -

- (IBAction)previewDocument:(id)sender 
{
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"pdf"];

    // Initialize Document Interaction Controller
    self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];

    // Configure Document Interaction Controller
    [self.documentInteractionController setDelegate:self];

    // Preview PDF
    [self.documentInteractionController presentOptionsMenuFromRect:down.frame inView:self.view animated:YES];

}
Run Code Online (Sandbox Code Playgroud)

我已经读过,我们也可以通过其他应用程序读取应用程序中的文件UIDocumentInteractionController.

在我的应用程序中,如何使用其他应用程序读取文件UIDocumentInteractionController?这一切是如何发生的?

ios uidocumentinteraction

4
推荐指数
1
解决办法
9822
查看次数

标签 统计

ios ×1

uidocumentinteraction ×1