【发布时间】:2016-09-19 10:52:14
【问题描述】:
使用 DKImagePickerController 从图库中选择多个图像和视频。但只能从图库中选择图像和视频,但无法从 DKAssets 中获取选择的图像并保存到数组。花了一天多。
下面是代码尝试:
let pickerController = DKImagePickerController()
pickerController.assetType = DKImagePickerControllerAssetType.AllAssets
pickerController.allowsLandscape = false
pickerController.allowMultipleTypes = true
pickerController.sourceType = DKImagePickerControllerSourceType.Both
pickerController.singleSelect = false
// Clear all the selected assets if you used the picker controller as a single instance.
// pickerController.defaultSelectedAssets = nil
pickerController.defaultSelectedAssets = self.assets
pickerController.didSelectAssets = { [unowned self] (assets: [DKAsset]) in
print("didSelectAssets")
}
self.presentViewController(pickerController, animated: true) {}
请指导,谢谢离子提前。
【问题讨论】:
-
到目前为止你做了什么?
-
您必须及时响应。以便您得到答案。
-
张贴在我迄今为止尝试过的内容之上,完成了很多谷歌搜索。还分享了我试图关注的链接。 github.com/zhangao0086/DKImagePickerController/issues/122
-
在下面发布了答案。检查一下,如果您遇到任何问题,请告诉我
标签: ios iphone swift uiimagepickercontroller