I want a file preview in application.
File is from web server (I have url of file.)
May can be any type. (image/audio/video/doc etc)
I want previewer like Finder previewer in Mac (by pressing space to any file in mac)
I want a file preview in application.
File is from web server (I have url of file.)
May can be any type. (image/audio/video/doc etc)
I want previewer like Finder previewer in Mac (by pressing space to any file in mac)
The easiest method, IMO, would be to simply use a UIWebView.
[self.webView loadRequest:[NSURLRequest requestWithURL:fileUrl]];
Where fileUrl
is an NSURL
pointing to the file's URL (remote or local). From my experience, UIWebViews are extremely capable of opening many different file types efficiently.
You should use UIDocumentInteractionController. You can look at the tutorial here for an example of how to use it:
The problem with UIWebView is that it has memory leaks that will cause your app to crash if you persistently preview images, you can check the behavior through instruments. I think the best way of doing so if you don't care about encryption is to use Quick Look Previewer. If you care about encryption, you can use UIImageView