有没有办法从iCloud Drive中选择文件UIImagePickerController()?
UIImagePickerController()
您可以通过以下方式显示控制器:
import MobileCoreServices let documentPickerController = UIDocumentPickerViewController(documentTypes: [String(kUTTypePDF), String(kUTTypeImage), String(kUTTypeMovie), String(kUTTypeVideo), String(kUTTypePlainText), String(kUTTypeMP3)], inMode: .Import) documentPickerController.delegate = self presentViewController(documentPickerController, animated: true, completion: nil)
在您的委托中实现方法:
func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL)
请注意,您无需设置要使用的iCloud权利UIDocumentPickerViewController。Apple 在此处提供了示例代码来演示如何使用此控制器
UIDocumentPickerViewController