UIDocumentInteractionController
作者:
某天天 | 来源:发表于
2018-06-11 15:07 被阅读0次UIDocumentInteractionController * documentInteraction = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:kXmlFilePath]];
documentInteraction.delegate = self;
// 支持文件类型,这里不说明就代表能打开所有文件的App!
documentInteraction.UTI = @"public.xml";
// 预览分享
[documentInteraction presentPreviewAnimated:YES];
#pragma mark - UIDocumentInteractionControllerDelegate
- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
{
return self;
}
- (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
{
return self.view;
}
- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
{
return self.view.frame;
}
本文标题:UIDocumentInteractionController
本文链接:https://www.haomeiwen.com/subject/yrnjjftx.html
网友评论