How to use “open in…” feature to iOS app?

后端 未结 3 1323
迷失自我
迷失自我 2020-12-15 12:40

I\'m not looking to add my app to the \"open in...\" list, but to get the list itself. And sending the file to another app.

I\'m working on internal communication ap

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-15 13:05

    UIDocumentInteractionController *controller = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:appFile]];
            self.controller.delegate = self;
    CGRect navRect = self.view.frame;
    [self.controller presentOptionsMenuFromRect:navRect inView:self.view animated:YES];
    

    Implement following UIDocumentInteractionControllerDelegate methods

    #pragma mark - UIDocumentInteractionControllerDelegate
    
    //===================================================================
    - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
    {
        return self;
    }
    
    - (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
    {
        return self.view;
    }
    
    - (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
    {
        return self.view.frame;
    }
    

提交回复
热议问题