【发布时间】:2019-07-09 12:19:04
【问题描述】:
就像使用UIImagePickerViewController 浏览 UIIMage。有没有办法在 Swift / 目标代码中浏览另一个文件?
if let fileURL = NSBundle.mainBundle().URLForResource("MyImage", withExtension: "jpg") {
// Instantiate the interaction controller
self.docController = UIDocumentInteractionController(URL: fileURL)
}
else {
shareButton.enabled = false
print("File missing! Button has been disabled")
}
【问题讨论】:
-
@R.yan:关于您的编辑,请不要添加 please-help 恳求人们的问题。它根本不提高可读性,也不是我们在这里的目标。