This commit is contained in:
neon443 committed 2026-05-07 08:35:50 +01:00
1 parent d320b9132c
commit 7f427f387c
1 file changed
+12
@@ -115,6 +115,18 @@ struct EmojiCollectionView: UIViewRepresentable {
fatalError("init(coder:) has not been implemented") 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 { override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count return items.count
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.