Git Product home page Git Product logo

documentcontroller's Introduction

DocumentController

文档查看器,查看doc、ppt、docx、pdf、xls格式文件

PhotoShoot

image

How To Use

/*
UIDocumentInteractionController是iOS 很早就出来的一个功能。但由于平时很少用到,压根就没有听说过它。而我们忽略的缺是一个功能强大的”文档阅读器”。
UIDocumentInteractionController主要由两个功能,一个是文件预览,另一个就是调用iPhoneh里第三方相关的app打开文档(注意这里不是根据url scheme 进行识别,而是苹果的自动识别)
*/
UIDocumentInteractionController *_documentController; //文档交互控制器


NSURL *url = [[NSBundle mainBundle] URLForResource:@"haha.pdf" withExtension:nil];

_documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
[_documentController setDelegate:self];

//当前APP打开  需实现协议方法才可以完成预览功能
[_documentController presentPreviewAnimated:YES];

//第三方打开 手机中安装有可以打开此格式的软件都可以打开
[_documentController presentOpenInMenuFromRect:btn.frame inView:self.view animated:YES];

documentcontroller's People

Contributors

zws-china avatar

Watchers

James Cloos 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.