11Pro 以下手机
if self.arrDataSource.count > 1 {
var insertIndexPathMap = [IndexPath]()
let section = self.arrDataSource.count - 1
for index in 0..<similarModelList.count {
let indexPa = IndexPath(item: index, section: section)
insertIndexPathMap.append(indexPa)
}
self.collectionView.performBatchUpdates({
self.collectionView.insertSections(IndexSet(integer: section))
self.collectionView.insertItems(at: insertIndexPathMap)
}) { (finish) in
if finish {
print("90900900")
}
}
} else {
self.collectionView.reloadData()
}
11Pro 以上手机必须加入 真他妈的坑
self.collectionView.layoutIfNeeded()
if self.arrDataSource.count > 1 {
var insertIndexPathMap = [IndexPath]()
let section = self.arrDataSource.count - 1
for index in 0..<similarModelList.count {
let indexPa = IndexPath(item: index, section: section)
insertIndexPathMap.append(indexPa)
}
self.collectionView.performBatchUpdates({
self.collectionView.insertSections(IndexSet(integer: section))
self.collectionView.insertItems(at: insertIndexPathMap)
}) { (finish) in
if finish {
print("90900900")
}
}
} else {
self.collectionView.reloadData()
self.collectionView.layoutIfNeeded()
}