[Solved] How to open Documents files of device programmatically in iOS [closed]


To open office files within an iOS app you can:

1- Use UIWebView . Here is a sample code with a document included in the app’s resources.

NSString *path = [[NSBundle mainBundle] pathForResource:@"document" ofType:@"ppt"];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:request];

2- You can use the QuickLook framework to preview the files “in app”.

Reference

Tutorial with sample code

3- You can use the document interaction controller to open the files using available apps that can handle them in the device.

tutorial

4- Avoid downloading and storing files without getting user permission, or at least informing users. You can even put this in your “terms and conditions”. Also, be sure not to include those downloaded URL in iClowd backups.

solved How to open Documents files of device programmatically in iOS [closed]