Tuesday, February 14, 2017

How to add an animation to the UICollectionView on data reload()

When you reload the data in UICollectionView, it will just reload the data without any progress. To overcome this you can simply animate the UICollectionView reload event when tapping on a UICollectionViewCell. I'll be using "driveCellCollectionView" as the collection view.


UIView.transition(with: driveCellCollectionView, duration: 0.5, options: .transitionFlipFromLeft, animations: {
            //Do the data reload here
            self.driveCellCollectionView.reloadData()
        }, completion: nil)


Once you have done this, you can simply run. Stay tuned for more tutorials.

No comments:

Post a Comment