Fix missing album thumbnails

pull/1/head
Michael Kirk 7 years ago
parent 6cbfc66ebb
commit 53101a3fc9

@ -47,10 +47,15 @@ class PhotoPickerAssetItem: PhotoGridItem {
} }
func asyncThumbnail(completion: @escaping (UIImage?) -> Void) -> UIImage? { func asyncThumbnail(completion: @escaping (UIImage?) -> Void) -> UIImage? {
var syncImageResult: UIImage?
// Surprisingly, iOS will opportunistically run the completion block sync if the image is
// already available
photoCollectionContents.requestThumbnail(for: self.asset, thumbnailSize: photoMediaSize.thumbnailSize) { image, _ in photoCollectionContents.requestThumbnail(for: self.asset, thumbnailSize: photoMediaSize.thumbnailSize) { image, _ in
syncImageResult = image
completion(image) completion(image)
} }
return nil return syncImageResult
} }
} }

Loading…
Cancel
Save