I use UICollectionView and reloadItemsAtIndexPaths for maximum efficiency and free animation.
Somehow, animation only starts occasionally (maybe you can use reuse cells?) I created a simple project with one UIViewController , UICollectionView and UIButton to help me start the animation.
Here is my code:
import UIKit class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate { var cells = [1] @IBOutlet weak var sampleCollectionView: UICollectionView! override func viewDidLoad() { super.viewDidLoad()
If you compile it and run it, you will see that these are only triggers.
I also tried to surround it with performBatchUpdates
Is there something I'm doing wrong? Is there any other way to achieve this?
source share