mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
idk
This commit is contained in:
1 file changed
+12
@@ -115,6 +115,18 @@ struct EmojiCollectionView: UIViewRepresentable {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
func makeSnapshot() -> NSDiffableDataSourceSnapshot<Int, String> {
|
||||
var snapshot = NSDiffableDataSourceSnapshot<Int, String>()
|
||||
snapshot.appendSections([0])
|
||||
snapshot.appendItems(items, toSection: 0)
|
||||
return snapshot
|
||||
}
|
||||
|
||||
func applySnapshot(animated: Bool) async {
|
||||
let snapshot = makeSnapshot()
|
||||
await (self.collectionView.dataSource as! UICollectionViewDiffableDataSource).apply(snapshot, animatingDifferences: animated)
|
||||
}
|
||||
|
||||
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return items.count
|
||||
}
|
||||
|
||||