Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
  2. print("ok")
  3.  
  4.  
  5.  
  6.  
  7. let cellRect = cell.contentView.convert(cell.contentView.bounds, to: UIScreen.main.coordinateSpace)
  8. if self.collectionView.frame.contains(cellRect) {
  9. let newcell = cell as! SavedImageCell
  10. newcell.setData(drawing: drawings.collection[indexPath.row])
  11. newcell.deselect()
  12. self.collectionView.deselectItem(at: indexPath, animated: false)
  13. newcell.setSelection(selectionMode)
  14. }
  15.  
  16.  
  17.  
  18.  
  19. }
  20.  
  21.  
  22.  
  23. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  24.  
  25.  
  26.  
  27. let cell = collectionView.dequeueReusableCell(withReuseIdentifier: sellId, for: indexPath) as! SavedImageCell
  28.  
  29.  
  30. cell.invisible()
  31. cell.deselect()
  32. self.collectionView.deselectItem(at: indexPath, animated: false)
  33. cell.setSelection(selectionMode)
  34.  
  35.  
  36.  
  37. return cell
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement