在预览中完全加载文档时,会调用UIDocumentInteractionControllerDelegate
的哪个委托功能?
只是分享,我已经尝试过了:
- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller
当我们关闭预览时会调用它。
答案 0 :(得分:2)
这是一个很好的解决方法,因为据我所知,在文档中似乎没有这样的完成处理程序。
-(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;
}
希望这有帮助。
路加