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
+3
-4
No files matched your search
@@ -21,8 +21,7 @@ struct EmojiCollectionView: UIViewRepresentable {
|
|||||||
func makeUIView(context: Context) -> UICollectionView {
|
func makeUIView(context: Context) -> UICollectionView {
|
||||||
let collectionView = context.coordinator as UICollectionViewController
|
let collectionView = context.coordinator as UICollectionViewController
|
||||||
collectionView.collectionView.register(PlainEmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plain")
|
collectionView.collectionView.register(PlainEmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plain")
|
||||||
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plainWithMenu")
|
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "full")
|
||||||
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "full")
|
|
||||||
collectionView.collectionView.dataSource = context.coordinator
|
collectionView.collectionView.dataSource = context.coordinator
|
||||||
collectionView.collectionView.delegate = context.coordinator
|
collectionView.collectionView.delegate = context.coordinator
|
||||||
return collectionView.collectionView
|
return collectionView.collectionView
|
||||||
@@ -163,11 +162,12 @@ struct EmojiCollectionView: UIViewRepresentable {
|
|||||||
let share = UIAction(title: "Share", image: UIImage(systemName: "square.and.arrow.up")) { action in
|
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 {
|
Task.detached {
|
||||||
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
|
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete.attributes.update(with: .destructive)
|
||||||
return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete])
|
return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class PlainEmojiCollectionViewCell: UICollectionViewCell {
|
|||||||
NSLayoutConstraint.activate(
|
NSLayoutConstraint.activate(
|
||||||
[
|
[
|
||||||
hostingController.view.topAnchor.constraint(equalTo: contentView.topAnchor),
|
hostingController.view.topAnchor.constraint(equalTo: contentView.topAnchor),
|
||||||
// hostingController.view.bottomAnchor.constraint(equalTo: contentView.topAnchor, ),
|
|
||||||
hostingController.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
|
hostingController.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
|
||||||
hostingController.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
|
hostingController.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
|
||||||
hostingController.view.heightAnchor.constraint(equalTo: hostingController.view.widthAnchor)
|
hostingController.view.heightAnchor.constraint(equalTo: hostingController.view.widthAnchor)
|
||||||
|
|||||||