mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
some stuff
This commit is contained in:
2 files changed
+2
-3
No files matched your search
@@ -21,7 +21,6 @@ struct EmojiCollectionView: UIViewRepresentable {
|
||||
func makeUIView(context: Context) -> UICollectionView {
|
||||
let collectionView = context.coordinator as UICollectionViewController
|
||||
collectionView.collectionView.register(PlainEmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plain")
|
||||
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plainWithMenu")
|
||||
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "full")
|
||||
collectionView.collectionView.dataSource = context.coordinator
|
||||
collectionView.collectionView.delegate = context.coordinator
|
||||
@@ -163,11 +162,12 @@ struct EmojiCollectionView: UIViewRepresentable {
|
||||
let share = UIAction(title: "Share", image: UIImage(systemName: "square.and.arrow.up")) { action in
|
||||
|
||||
}
|
||||
let delete = UIAction(title: "Delete", image: UIImage(systemName: "plus")) { action in
|
||||
let delete = UIAction(title: "Delete", image: UIImage(systemName: "trash")) { action in
|
||||
Task.detached {
|
||||
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
|
||||
}
|
||||
}
|
||||
delete.attributes.update(with: .destructive)
|
||||
return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ class PlainEmojiCollectionViewCell: UICollectionViewCell {
|
||||
NSLayoutConstraint.activate(
|
||||
[
|
||||
hostingController.view.topAnchor.constraint(equalTo: contentView.topAnchor),
|
||||
// hostingController.view.bottomAnchor.constraint(equalTo: contentView.topAnchor, ),
|
||||
hostingController.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
|
||||
hostingController.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
|
||||
hostingController.view.heightAnchor.constraint(equalTo: hostingController.view.widthAnchor)
|
||||
|
||||