added a menu

This commit is contained in:
Nihaal Sharma committed 2026-04-27 12:43:51 +01:00
1 parent dda5748e22
commit 5e5a04abf8
3 files changed
+44 -4

No files matched your search

+6
View File
@@ -48,6 +48,8 @@
A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; }; A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; };
A957C17F2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; }; A957C17F2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; };
A957C1802ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; }; A957C1802ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; };
A975F9162F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A975F9152F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift */; };
A975F9172F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A975F9152F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift */; };
A9773C2F2EA54AF000F3B753 /* StickerPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */; }; A9773C2F2EA54AF000F3B753 /* StickerPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */; };
A97BFFBC2F9E6092000441E5 /* EmptyEmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97BFFBB2F9E6092000441E5 /* EmptyEmojiPackView.swift */; }; A97BFFBC2F9E6092000441E5 /* EmptyEmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97BFFBB2F9E6092000441E5 /* EmptyEmojiPackView.swift */; };
A97BFFBD2F9E6092000441E5 /* EmptyEmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97BFFBB2F9E6092000441E5 /* EmptyEmojiPackView.swift */; }; A97BFFBD2F9E6092000441E5 /* EmptyEmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97BFFBB2F9E6092000441E5 /* EmptyEmojiPackView.swift */; };
@@ -209,6 +211,7 @@
A957C1792ECE542D00EA3EE9 /* GifManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifManager.swift; sourceTree = "<group>"; }; A957C1792ECE542D00EA3EE9 /* GifManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifManager.swift; sourceTree = "<group>"; };
A957C17D2ECFAA1100EA3EE9 /* GifView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifView.swift; sourceTree = "<group>"; }; A957C17D2ECFAA1100EA3EE9 /* GifView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifView.swift; sourceTree = "<group>"; };
A969D6932EA3E86500399C05 /* Messages.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Messages.framework; path = Library/Frameworks/Messages.framework; sourceTree = DEVELOPER_DIR; }; A969D6932EA3E86500399C05 /* Messages.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Messages.framework; path = Library/Frameworks/Messages.framework; sourceTree = DEVELOPER_DIR; };
A975F9152F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlainWithMenuEmojiCollectionViewCell.swift; sourceTree = "<group>"; };
A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerPreview.swift; sourceTree = "<group>"; }; A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerPreview.swift; sourceTree = "<group>"; };
A97BFFBB2F9E6092000441E5 /* EmptyEmojiPackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyEmojiPackView.swift; sourceTree = "<group>"; }; A97BFFBB2F9E6092000441E5 /* EmptyEmojiPackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyEmojiPackView.swift; sourceTree = "<group>"; };
A97BFFBE2F9E745C000441E5 /* EmojiCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiCollectionViewCell.swift; sourceTree = "<group>"; }; A97BFFBE2F9E745C000441E5 /* EmojiCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiCollectionViewCell.swift; sourceTree = "<group>"; };
@@ -432,6 +435,7 @@
A917BACD2F9B787B008DB31E /* EmojiCollectionView.swift */, A917BACD2F9B787B008DB31E /* EmojiCollectionView.swift */,
A917BAD02F9B7B68008DB31E /* PlainEmojiCollectionViewCell.swift */, A917BAD02F9B7B68008DB31E /* PlainEmojiCollectionViewCell.swift */,
A97BFFBE2F9E745C000441E5 /* EmojiCollectionViewCell.swift */, A97BFFBE2F9E745C000441E5 /* EmojiCollectionViewCell.swift */,
A975F9152F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift */,
); );
path = CollectionView; path = CollectionView;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -703,6 +707,7 @@
A949B1FB2EA0518800215164 /* SlackResponse.swift in Sources */, A949B1FB2EA0518800215164 /* SlackResponse.swift in Sources */,
A957C17A2ECE542D00EA3EE9 /* GifManager.swift in Sources */, A957C17A2ECE542D00EA3EE9 /* GifManager.swift in Sources */,
A9C52F6F2F89A22000078588 /* Wiggle.metal in Sources */, A9C52F6F2F89A22000078588 /* Wiggle.metal in Sources */,
A975F9162F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift in Sources */,
A9BDEADE2F82BC93002798DF /* NoStickersView.swift in Sources */, A9BDEADE2F82BC93002798DF /* NoStickersView.swift in Sources */,
A955B3F52EC22EE900E1732D /* SearchView.swift in Sources */, A955B3F52EC22EE900E1732D /* SearchView.swift in Sources */,
A935437B2EB2A3C800BB80A4 /* FilterCategory.swift in Sources */, A935437B2EB2A3C800BB80A4 /* FilterCategory.swift in Sources */,
@@ -780,6 +785,7 @@
A9A7A4462F68360900BB84C6 /* Pagination.swift in Sources */, A9A7A4462F68360900BB84C6 /* Pagination.swift in Sources */,
A957C17C2ECE542D00EA3EE9 /* GifManager.swift in Sources */, A957C17C2ECE542D00EA3EE9 /* GifManager.swift in Sources */,
A9104C7F2EB4022500D160EA /* MSSticker.swift in Sources */, A9104C7F2EB4022500D160EA /* MSSticker.swift in Sources */,
A975F9172F9F800A00A5C62E /* PlainWithMenuEmojiCollectionViewCell.swift in Sources */,
A9C52F762F89A93D00078588 /* URL.swift in Sources */, A9C52F762F89A93D00078588 /* URL.swift in Sources */,
A9B9A8302EB2CD0B004C9245 /* Emoji.swift in Sources */, A9B9A8302EB2CD0B004C9245 /* Emoji.swift in Sources */,
A9C52F702F89A22000078588 /* Wiggle.metal in Sources */, A9C52F702F89A22000078588 /* Wiggle.metal in Sources */,
@@ -18,8 +18,9 @@ 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: "plainCell") collectionView.collectionView.register(PlainEmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plain")
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "cell") collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plainWithMenu")
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
@@ -43,6 +44,7 @@ struct EmojiCollectionView: UIViewRepresentable {
enum Style { enum Style {
case plain case plain
case plainWithMenu
case full case full
} }
@@ -95,9 +97,12 @@ struct EmojiCollectionView: UIViewRepresentable {
let cell: PlainEmojiCollectionViewCell let cell: PlainEmojiCollectionViewCell
switch style { switch style {
case .plain: case .plain:
cell = collectionView.dequeueReusableCell(withReuseIdentifier: "plainCell", for: indexPath) as! PlainEmojiCollectionViewCell cell = collectionView.dequeueReusableCell(withReuseIdentifier: "plain", for: indexPath) as! PlainEmojiCollectionViewCell
case .plainWithMenu:
fatalError()
// cell = collectionView.dequeueReusableCell(withReuseIdentifier: "plainWithMenu", for: <#T##IndexPath#>)
case .full: case .full:
cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! EmojiCollectionViewCell cell = collectionView.dequeueReusableCell(withReuseIdentifier: "full", for: indexPath) as! EmojiCollectionViewCell
} }
guard !hoarder.trie.dict.isEmpty else { return cell } guard !hoarder.trie.dict.isEmpty else { return cell }
@@ -128,6 +133,22 @@ struct EmojiCollectionView: UIViewRepresentable {
return CGSize(width: width, height: width+labelHeight) return CGSize(width: width, height: width+labelHeight)
} }
override func collectionView(
_ collectionView: UICollectionView,
contextMenuConfigurationForItemAt indexPath: IndexPath,
point: CGPoint
) -> UIContextMenuConfiguration? {
return UIContextMenuConfiguration(
identifier: nil,
previewProvider: nil) { suggestedActions in
let emojiName = self.pack.items[indexPath.row]
let label = UIAction(title: "idk", image: UIImage(systemName: "plus")) { action in
print("idk")
}
return UIMenu(title: emojiName, children: [label])
}
}
} }
} }
@@ -0,0 +1,13 @@
//
// PlainWithMenuEmojiCollectionViewCell.swift
// StickerSlack
//
// Created by neon443 on 27/04/2026.
//
import Foundation
import UIKit
class PlainWithMenuEmojiCollectionViewCell: PlainEmojiCollectionViewCell {
// override func
}
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.