Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool {
- guard let dragCell = cellForItem(at: indexPath) as? ActivityPhotoGalleryCell else { return false }
- draggingCell = dragCell
- originalColor = dragCell.backgroundColor
- originalSize = dragCell.imageView.bounds.size
- newSize.width *= 0.7
- newSize.height *= 0.7
- dragCell.imageView.bounds.size = newSize
- dragCell.backgroundColor = UIColor.clear
- dragCell.setNeedsDisplay()
- dragCell.isDragging = true
- return super.beginInteractiveMovementForItem(at: indexPath)
- }
- var sizeForItem = CGSize(width: widthPerItem, height: widthPerItem)
- let cell = collectionView.cellForItem(at: indexPath) as? CustomCellObject
- if (cell?.isDragging ?? false) {
- sizeForItem.height *= 0.7
- sizeForItem.width *= 0.7
- }
- return sizeForItem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement