S
Size: a a a
S
A
S
NN
A
collectionView.visibleCells.first?.isHidden =
true
snapshot.deleteSections([.carousel])
и так и так пробовалS
S
V
V
S
V
A
DK
КТ
КТ
NK
DH
🚧
A
///
Update the view
private
func show(state: TreatmentsListState) {
// create snapshot
var snapshot = NSDiffableDataSourceSnapshot<Section, TreatmentItem>()
snapshot.appendSections([.carousel])
let carouselItems = state.featuredTreatments.map { TreatmentItem.featured($0) }
self.updatePageControl(count: carouselItems.count)
snapshot.appendItems(carouselItems)
snapshot.appendSections([.treatmentsGrid])
snapshot.appendItems(state.filteredTreatments.map { .treatment($0) })
retryView.isHidden = state.loadingError ==
nil || !state.treatments.isEmpty
currentNoResultsView?.isHidden = (state.treatments.isEmpty || !state.filteredTreatments.isEmpty)
collectionView.isHidden = !retryView.isHidden
treatmentsView.showAllButton.isHidden = state.selectedFilters.isEmpty
collectionView.showAnimatedGradientSkeleton()
if state.treatments.isEmpty && !collectionView.isSkeletonActive {
filterHeaderView.showLoading()
collectionView.showAnimatedGradientSkeleton()
collectionView.isScrollEnabled =
false
}
else
if !state.isLoading && collectionView.isSkeletonActive {
collectionView.hideSkeleton(reloadDataAfter:
false, transition: .none)
filterHeaderView.hideLoading()
collectionView.isScrollEnabled =
true
if state.featuredTreatments.isEmpty && collectionView.isSkeletonActive {
snapshot.deleteSections([.carousel])
self.currentPageControlView?.isHidden =
true
dataSource.apply(snapshot)
collectionView.reloadData()
}
dataSource.apply(snapshot, animatingDifferences:
false)
}
else
if !state.treatments.isEmpty && !collectionView.isSkeletonActive {
dataSource.apply(snapshot)
}
filterHeaderView.selectedFilters = state.selectedFilters
}
A
dataSource.apply(snapshot)
я добавил но ничего не поменялось