I am using the below code. When I try to export to a pdf, it works perfect. A menu shows up and opens the pdf in iBooks. But when I choose epub, the menu shows up and nothing happens when I click iBooks. Any idea what I am missing?
- (IBAction)openDocument:(id)sender {
UIButton *button = (UIButton *)sender;
NSString *applicationDocumentsDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *storePath = [applicationDocumentsDir stringByAppendingPathComponent:@"/pdf/helga.epub"];
//NSString *storePath = [applicationDocumentsDir stringByAppendingPathComponent:@"/pdf/daskleinebuch.pdf"];
NSURL *URL = [NSURL fileURLWithPath:storePath];
//NSURL *URL = [[NSBundle mainBundle] URLForResource:@"sample" withExtension:@"pdf"];
if (URL) {
// Initialize Document Interaction Controller
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
// Configure Document Interaction Controller
[self.documentInteractionController setDelegate:self];
// Present Open In Menu
[self.documentInteractionController presentOpenInMenuFromRect:[button frame] inView:self.view animated:YES];
}
}