0
votes

I have a performance issue when scrolling vertical collection cells with horizontal collection view in it. The reason is cell's data reusing - horizontal collection view reloading on every parent cell reuse cycle. Does anybody know how can I avoid such amount of reloads ?

var items: [ProductItem] {
  didSet {
    collectionView.reloadData()
  }
}

override func prepareForReuse() {
  super.prepareForReuse()

  items = nil
}
1

1 Answers

0
votes

UICollectionView and UITableView use every cell again and again, that is how they work.

It you get your data from web ever time then cache them. You can use image-caching libraries.