Created
December 19, 2019 02:52
-
-
Save alcidesjunior/fd1731ca19e1f8000b61590e18a5b606 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "movieCell", for: indexPath) as! MovieCollectionViewCell | |
cell.movieTitle.text = self.movies[indexPath.item].originalTitle | |
guard let imageUrl = URL(string: "\(EndPoints.baseImageUrl.rawValue)\(self.movies[indexPath.item].posterPath)") else{return cell} | |
DispatchQueue.main.async { | |
cell.movieImageView.load(url: imageUrl) | |
} | |
return cell | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment