mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
deleting works from context menu, eg downloadedview
This commit is contained in:
1 file changed
+9
-11
@@ -45,17 +45,11 @@ struct EmojiCollectionView: UIViewRepresentable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if items != context.coordinator.items || context.coordinator.pack != pack {
|
if items != context.coordinator.items || context.coordinator.pack != pack {
|
||||||
// context.coordinator.items = items
|
context.coordinator.items = items
|
||||||
// context.coordinator.pack = pack
|
context.coordinator.pack = pack
|
||||||
// uiView.reloadData()
|
uiView.reloadData()
|
||||||
// }
|
}
|
||||||
|
|
||||||
// let oldItems = context.coordinator.items
|
|
||||||
// let newItems = items
|
|
||||||
// newItems.difference(from: oldItems)
|
|
||||||
//// context.coordinator.items
|
|
||||||
// uiView.deleteItems(at: <#T##[IndexPath]#>)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeCoordinator() -> Coordinator {
|
func makeCoordinator() -> Coordinator {
|
||||||
@@ -218,6 +212,10 @@ struct EmojiCollectionView: UIViewRepresentable {
|
|||||||
Task.detached {
|
Task.detached {
|
||||||
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
|
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
|
||||||
}
|
}
|
||||||
|
self.items.remove(at: indexPath.row)
|
||||||
|
collectionView.performBatchUpdates {
|
||||||
|
collectionView.deleteItems(at: [indexPath])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
delete.attributes.update(with: .destructive)
|
delete.attributes.update(with: .destructive)
|
||||||
return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete])
|
return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete])
|
||||||
|
|||||||