Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
- if collectionView == self.authorList {
- let imageUrl = authorArray[indexPath.row].image
- let cellNot = cell as! CollectionCellSlider
- if !imageUrl.isEmpty {
- cellNot.bookImg.loadImageUsingCache(withUrl: imageUrl)
- collectionView.layoutSubviews()
- }
- } else if collectionView == self.popularList {
- let imageUrl = booksArray[indexPath.row].image
- let cellNot = cell as! CollectionCellSlider
- if !imageUrl.isEmpty {
- cellNot.bookImg.loadImageUsingCache(withUrl: imageUrl)
- collectionView.layoutSubviews()
- }
- } else if collectionView == self.editorBookList {
- let imageUrl = editorBooksArray[indexPath.row].image
- let cellNot = cell as! CollectionCellSlider
- if !imageUrl.isEmpty {
- cellNot.bookImg.loadImageUsingCache(withUrl: imageUrl)
- collectionView.layoutSubviews()
- }
- } else if collectionView == self.slider {
- let imageUrl = sliderList[indexPath.row].image
- let cellNot = cell as! CollectionCellSlider
- if !imageUrl.isEmpty {
- cellNot.bookImg.loadImageUsingCache(withUrl: imageUrl)
- collectionView.layoutSubviews()
- }
- }
- }
Add Comment
Please, Sign In to add comment