Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
- print("ok")
- let cellRect = cell.contentView.convert(cell.contentView.bounds, to: UIScreen.main.coordinateSpace)
- if self.collectionView.frame.contains(cellRect) {
- let newcell = cell as! SavedImageCell
- newcell.setData(drawing: drawings.collection[indexPath.row])
- newcell.deselect()
- self.collectionView.deselectItem(at: indexPath, animated: false)
- newcell.setSelection(selectionMode)
- }
- }
- func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
- let cell = collectionView.dequeueReusableCell(withReuseIdentifier: sellId, for: indexPath) as! SavedImageCell
- cell.invisible()
- cell.deselect()
- self.collectionView.deselectItem(at: indexPath, animated: false)
- cell.setSelection(selectionMode)
- return cell
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement