-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
I have 3 dummy items in data for shimmer but only third one is animating after I scroll the horizontal collectionView, which is offscreen before you scroll. The first and second items is not animating. Any clues or possible solutions?
extension NewsCollectionTableViewCell: UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
data.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard
let cell: NewsCollectionViewCell = collectionView.dequeueCell(withType: NewsCollectionViewCell.self, for: indexPath),
let model = data.item(at: indexPath.item)
else { return .init() }
cell.setup(with: model)
return cell
}
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
cell.setTemplateWithSubviews(isLoading, viewBackgroundColor: .themeBackground)
}
Metadata
Metadata
Assignees
Labels
No labels