美文网首页
iOS 调用其他方式打开文件(UIDocumentInterac

iOS 调用其他方式打开文件(UIDocumentInterac

作者: 路边的风景呢 | 来源:发表于2018-06-11 15:22 被阅读9次

    首先遵循代理方法:

    UIDocumentInteractionControllerDelegate   

    然后声明一个属性 :

    @property(nonatomic,strong)UIDocumentInteractionController *documentController;

    然后在你用到的地方初始化:

     _documentController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:“unzipPath”]];

            _documentController.delegate = self;

            [_documentController presentOpenInMenuFromRect:self.view.bounds inView:self.view animated:YES];

    “unzipPath”。是你要分享的参数 也就是你要分享的东西

    第一用这个 接下来会继续探索 UIDocumentInteractionController 的使用 慢慢学习

    相关文章

      网友评论

          本文标题:iOS 调用其他方式打开文件(UIDocumentInterac

          本文链接:https://www.haomeiwen.com/subject/rerheftx.html