是否可以使用UIDocumentPickerViewController允许用户选择多个文件以从另一个应用程序导入?
使用以下代码片段,这将在标题旁边添加“选择”按钮,以一次选择多个文件并将其导入。
UIDocumentPickerViewController *dvc = [[UIDocumentPickerViewController alloc]initWithDocumentTypes:arrContents inMode:UIDocumentPickerModeImport];
dvc.delegate = self;
[self presentViewController:dvc animated:true completion:^{
if (@available(iOS 11.0, *)) {
dvc.allowsMultipleSelection = true;
}
}];
和
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray <NSURL *>*)urls
获取所选文件的列表。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句