GithubHelp home page GithubHelp logo

vinod1988 / afquicklookview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bsideup/afquicklookview

0.0 2.0 0.0 60 KB

AFNetworking Extension for document previews of remote files

License: MIT License

afquicklookview's Introduction

AFQuickLookView

AFQuickLookView is an extension for AFNetworking that allows the display of remote files in a UIView subclass.

This is still in early stages of development, so proceed with caution when using this in a production application. Any bug reports, feature requests, or general feedback at this point would be greatly appreciated.

Example Usage

Add an instance of the AFQuickLookView to the view of you choosing:

CGRect frame = CGRectMake(0, 100, 300, 300);
AFQuickLookView* quickLookView = [[AFQuickLookView alloc] initWithFrame:frame];
[self.view addSubview:quickLookView];

Trigger loading a remote document:

NSString* fileURLString = @"http://bit.ly/xngAttPDF";
NSURL* fileURL = [NSURL URLWithString:fileURLString];
[quickLookView previewDocumentAtURL:fileURL success:^{
} failure:^(NSError *error) {
NSLog(@"Could not preview document. Error:%@", error);
}];

Supported file formats

  • iWork documents
  • Microsoft Office documents (Office '97 and newer)
  • Rich Text Format (RTF) documents
  • PDF files
  • Images
  • Text files
  • Comma-separated value (csv) files

HTTP layer Details

In order for AFQuickLookView to work with remote files, the server response has to comply to one of these options:

a) include a Content-Type header, e.g.:

Content-Type: application/pdf

b) include the right filename and extension in the Content-Disposition header, i.e.:

Content-Disposition: attachment;filename="examplefile.pdf"

Contact

XING AG

Claudiu-Vlad Ursache

License

AFQuickLookView is available under the MIT license. See the LICENSE file for more info.

afquicklookview's People

Contributors

bsideup avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.