Ich versuche folgende Methode, um Asset von lokalen Bezeichner abrufen und in der Sammlungsansicht anzeigen, aber scroll ruckartig beim Laden werden.Ich versuche, Asset von lokalen Bezeichner abzurufen und Bilder in CollectionView anzuzeigen, aber es macht Rollruck
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "GridCell", for: indexPath) as! GridCell
cell.representedAssetIdentifier = "some uri"
let requestOptions = PHImageRequestOptions()
requestOptions.isSynchronous = false
let asset = PHAsset.fetchAssets(withLocalIdentifiers: ["some uri"!], options: .none).firstObject
imageManager.requestImage(for: asset!, targetSize: thumbnailSize, contentMode: .aspectFit, options: requestOptions, resultHandler: { result, info in
if cell.representedAssetIdentifier =="someuri" {
cell.imageview.image = result
}
})