diff --git "a/DailyFeed/\360\237\223\261Controllers/BookmarkViewController.swift" "b/DailyFeed/\360\237\223\261Controllers/BookmarkViewController.swift" index c3d5474..dc04900 100644 --- "a/DailyFeed/\360\237\223\261Controllers/BookmarkViewController.swift" +++ "b/DailyFeed/\360\237\223\261Controllers/BookmarkViewController.swift" @@ -110,6 +110,16 @@ extension BookmarkViewController: UICollectionViewDelegate, UICollectionViewData let cell = collectionView.cellForItem(at: indexPath) self.performSegue(withIdentifier: R.segue.bookmarkViewController.bookmarkSourceSegue, sender: cell) } + + ///Animate the cell by scaling it, just before it appears on screen + func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + if collectionView.isDragging { + cell.transform = .init(scaleX: 0.5, y: 0.5) + UIView.animate(withDuration: 0.3) { + cell.transform = .identity + } + } + } } // MARK: - DZNEmptyDataSet Delegate Methods diff --git "a/DailyFeed/\360\237\223\261Controllers/DailyFeedNewsController+UICollectionView.swift" "b/DailyFeed/\360\237\223\261Controllers/DailyFeedNewsController+UICollectionView.swift" index 791b0c8..200b655 100644 --- "a/DailyFeed/\360\237\223\261Controllers/DailyFeedNewsController+UICollectionView.swift" +++ "b/DailyFeed/\360\237\223\261Controllers/DailyFeedNewsController+UICollectionView.swift" @@ -91,5 +91,17 @@ extension DailyFeedNewsController: UICollectionViewDragDelegate { } } +///UICollectionViewDelegate +extension DailyFeedNewsController: UICollectionViewDelegate { + ///Animate the cell by scaling it, just before it appears on screen + func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + if collectionView.isDragging { + cell.transform = .init(scaleX: 0.5, y: 0.5) + UIView.animate(withDuration: 0.3) { + cell.transform = .identity + } + } + } +}