Skip to content

DocumentPicker----Guideline 2.5.15 Performance Software Requirements

Notifications You must be signed in to change notification settings

NK-iOS/NKDocumentPickerViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

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
  • 简书

About

DocumentPicker----Guideline 2.5.15 Performance Software Requirements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors