如何使用按钮单击功能将[PHAsset]转换为Swift中的PHAsset

时间:2017-05-31 07:46:45

标签: ios arrays swift uiimagepickercontroller phasset

public func nohanaImagePicker(_ picker: NohanaImagePickerController, didFinishPickingPhotoKitAssets pickedAssts: [PHAsset])
{
    print("Completed\n\tpickedAssets = \(pickedAssts)")
    self.getAssetThumbnail(asset: pickedAssts)
    picker.dismiss(animated: true, completion: nil)
    self.ImageCollectionView.reloadData()
}

任何人都可以解释如何将[PHAsset]值转换为PHAsset

1 个答案:

答案 0 :(得分:0)

[PHAsset]PHAsset个对象的数组。您可以像这样选择数组的第一个对象。

let phAsset = pickedAssts.first