gpt4 book ai didi

ios - 加载文档时 UIDocumentInteractionControllerDelegate 检查

转载 作者:行者123 更新时间:2023-11-28 21:36:15 27 4
gpt4 key购买 nike

当文档在预览中完全加载时,UIDocumentInteractionControllerDelegate 的哪个委托(delegate)函数被调用?
只是为了分享,我已经尝试过:

- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller  

当我们关闭预览时调用它。

最佳答案

这有点变通,因为据我所知,文档中似乎没有针对此的完成处理程序。

-(void)presentDocument:(NSURL*)url{
UIDocumentInteractionController *docInteration = [UIDocumentInteractionController interactionControllerWithURL:url];
docInteration.UTI = @"com.adobe.pdf";
docInteration.delegate = self;
[docInteration presentPreviewAnimated:YES];
}

-(void)documentInteractionControllerDidEndPreview: (UIDocumentInteractionController *)controller{
[self.navigationController dismissViewControllerAnimated:NO completion:nil];
}

- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller{

UIViewController * vc = [[UIViewController alloc]init];
[self.navigationController presentViewController:vc
animated:YES
completion:^{
//This is ran once the document animation has completed
}];
return vc;
}

希望这对您有所帮助。
卢克

关于ios - 加载文档时 UIDocumentInteractionControllerDelegate 检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33820335/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com