Skip to content

Instantly share code, notes, and snippets.

@gaeng2y
Created March 19, 2025 07:58
Show Gist options
  • Select an option

  • Save gaeng2y/ae7c2ed839d53795032bcbd3926eb969 to your computer and use it in GitHub Desktop.

Select an option

Save gaeng2y/ae7c2ed839d53795032bcbd3926eb969 to your computer and use it in GitHub Desktop.
@MainActor
class MyDelegate: UICollectionViewDelegate {
func collectionView(_ view: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt item: IndexPath) {
let ids = getThumbnailIDs(for: item)
Task {
let thumbnails = await fetchThumbnails(for: ids)
display(thumbnails, in: cell)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment