How to open PDF from iBooks in iPhone sdk?

I need to open a pdf file, which is located in my local resources folder with iBooks. I have done the following:

-(IBAction)openingPDF:(id)sender { //get path to file you want to open NSString *fileToOpen = [[NSBundle mainBundle] pathForResource:@"Family_Assistance_Act-1" ofType:@"pdf"]; //create NSURL to that path NSURL *url = [NSURL fileURLWithPath:fileToOpen]; //use the UIDocInteractionController API to get list of devices that support the file type UIDocumentInteractionController* docController = [UIDocumentInteractionController interactionControllerWithURL:url]; [docController retain]; //present a drop down list of the apps that support the file type, click an item in the list will open that app while passing in the file. BOOL isValid = [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; } 

Now I want to close my application and open this pdf file using iBooks. How to achieve this? What else do I need to add? Any suggestions or samples? Thanks in advance.

+4
source share

Source: https://habr.com/ru/post/1379435/


All Articles