I am using UIDocumentInteractionController
for opening documents in my app. I have used method below for previewing the PDF file:-
- (IBAction)p
Previewing the PDF document and sharing.
Set Delegate Method:- UIDocumentInteractionControllerDelegate
NSURL *URL = [[NSBundle mainBundle] URLForResource:@"Your PDF Name" withExtension:@"pdf"];
UIDocumentInteractionController *documentInteractionController =[UIDocumentInteractionController interactionControllerWithURL:URL];
documentInteractionController.delegate = self;
[documentInteractionController presentPreviewAnimated:YES];
- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller {
return self;
}
If you have any confusion, click on the below link and read : https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/PreviewingandOpeningItems.html