Code Monkey home page Code Monkey logo

nkdocumentpickerviewcontroller's Introduction

NKDocumentPickerViewController

一行代码实现从手机上传文件到APP

  • Guideline 2.5.15 - Performance - Software Requirements
  • 由于最近项目审核遇到的一些问题,一直不理解苹果爸爸到底是让我怎么修改,,,最后才明白苹果的新规,遇到类似问题的可以参考。
  • 利用UIDocumentPickerViewController从手机上传文件到app!有时候会有这么一些需求,需要用户上传自己的一些xml,doc,pdf文档.可是iOS上并没有直观的文件管理系统.这时候Document Picker就可以帮助我们访问iCould,dropBox等应用中的文件.然后进行相关操作.

上线APP:

我的超级文件

方法调用:

[[NKSeleDocumentTool shareDocumentTool] seleDocumentWithDocumentTypes:@[@"public.data"] Mode:UIDocumentPickerModeImport controller:self finishBlock:^(NSArray<NSURL *> *urls) {
      NSURL *fileUrl = urls.firstObject;
      // 选择的文件数据
      NSData *fileData = [NSData dataWithContentsOfURL:fileUrl];
}];
  • DocumentTypes参数可以筛选自己需要的文件类型,可以参考下边这张图:

效果预览:

一行代码实现文件选择,简洁方便

其他:

  • 自由开发者交流群:811483008
  • 简书

nkdocumentpickerviewcontroller's People

Contributors

nk-ios avatar

Watchers

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