You do not want to convert PHAssetto UIImage. I do not know if this is possible; it should not be, because PHAssetthey UIImagehave different properties, behavior, etc. Conversely, all properties UIImagecan be obtained from PHAsset, but not vice versa.
Instead, change the data source in the collection view to [UIImage], and instead change PHAssetto UIImage. This approach is clean and solves another problem: convert UIImageto PHImage.
source
share