Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. override func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool {
  2. guard let dragCell = cellForItem(at: indexPath) as? ActivityPhotoGalleryCell else { return false }
  3. draggingCell = dragCell
  4. originalColor = dragCell.backgroundColor
  5. originalSize = dragCell.imageView.bounds.size
  6. newSize.width *= 0.7
  7. newSize.height *= 0.7
  8. dragCell.imageView.bounds.size = newSize
  9. dragCell.backgroundColor = UIColor.clear
  10. dragCell.setNeedsDisplay()
  11. dragCell.isDragging = true
  12.  
  13. return super.beginInteractiveMovementForItem(at: indexPath)
  14. }
  15.  
  16. var sizeForItem = CGSize(width: widthPerItem, height: widthPerItem)
  17.  
  18. let cell = collectionView.cellForItem(at: indexPath) as? CustomCellObject
  19.  
  20. if (cell?.isDragging ?? false) {
  21. sizeForItem.height *= 0.7
  22. sizeForItem.width *= 0.7
  23. }
  24.  
  25. return sizeForItem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement