mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
Compare commits
0
Commits
swift6
..
21a67416a1
No files matched your search
@@ -1 +0,0 @@
|
||||
Resources/giphy_api_key.txt
|
||||
@@ -3,7 +3,7 @@
|
||||
<div align="center">
|
||||
<br/>
|
||||
<p>
|
||||
<img src="https://github.com/neon443/StickerSlack/blob/main/Resources/Assets.xcassets/icon.imageset/StickerSlack-iOS-Default-1024x1024@1x.png?raw=true" title="icon" alt="icon" width="100" />
|
||||
<img src="https://files.catbox.moe/d8go4n.png" title="icon" alt="icon" width="100" />
|
||||
</p>
|
||||
<p>
|
||||
every slack emoji as an iMessage sticker
|
||||
@@ -13,8 +13,8 @@
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://apps.apple.com/us/app/stickerslack/id6754695612">
|
||||
appstore
|
||||
<a href="https://testflight.apple.com/join/JWTN897S">
|
||||
testflight
|
||||
</a>
|
||||
</p>
|
||||
<br/>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "giphy black.png",
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"filename" : "giphy.png",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
Binary file not shown.
File renamed without changes.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@@ -44,7 +44,7 @@
|
||||
A957C17E2ECFAA1100EA3EE9 /* 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 */; };
|
||||
A9773C2F2EA54AF000F3B753 /* StickerPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */; };
|
||||
A9773C2F2EA54AF000F3B753 /* EmojiPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */; };
|
||||
A986A6AE2EB658DF00B6E0FA /* Messages.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A969D6932EA3E86500399C05 /* Messages.framework */; };
|
||||
A986A6BA2EB658E100B6E0FA /* StickerSlackiMessageApp.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A986A6AD2EB658DF00B6E0FA /* StickerSlackiMessageApp.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
A986A6C12EB6595F00B6E0FA /* EmojiHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A949B1F72EA04F2300215164 /* EmojiHoarder.swift */; };
|
||||
@@ -58,8 +58,6 @@
|
||||
A99589AF2F5E0D83003A4A8C /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = A99589AE2F5E0D83003A4A8C /* image.png */; };
|
||||
A99589B02F5E0D83003A4A8C /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = A99589AE2F5E0D83003A4A8C /* image.png */; };
|
||||
A99589B12F5E0D83003A4A8C /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = A99589AE2F5E0D83003A4A8C /* image.png */; };
|
||||
A995D95B2F6EBBDD0043E5F5 /* TestStructures.swift in Sources */ = {isa = PBXBuildFile; fileRef = A995D95A2F6EBBDD0043E5F5 /* TestStructures.swift */; };
|
||||
A995D95C2F6EBBDD0043E5F5 /* TestStructures.swift in Sources */ = {isa = PBXBuildFile; fileRef = A995D95A2F6EBBDD0043E5F5 /* TestStructures.swift */; };
|
||||
A9A7A43F2F6835F800BB84C6 /* Trending.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A43E2F6835F800BB84C6 /* Trending.swift */; };
|
||||
A9A7A4402F6835F800BB84C6 /* Trending.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A43E2F6835F800BB84C6 /* Trending.swift */; };
|
||||
A9A7A4422F68360200BB84C6 /* GifObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A4412F68360200BB84C6 /* GifObject.swift */; };
|
||||
@@ -72,17 +70,6 @@
|
||||
A9A7A44C2F6837A800BB84C6 /* GiphyUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A44A2F6837A800BB84C6 /* GiphyUser.swift */; };
|
||||
A9A7A44E2F68383900BB84C6 /* GiphyImages.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A44D2F68383900BB84C6 /* GiphyImages.swift */; };
|
||||
A9A7A44F2F68383900BB84C6 /* GiphyImages.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A44D2F68383900BB84C6 /* GiphyImages.swift */; };
|
||||
A9A7A4572F69568700BB84C6 /* GifHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EE2F5B004800A57668 /* GifHoarder.swift */; };
|
||||
A9A7A4582F69569100BB84C6 /* Trending.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A43E2F6835F800BB84C6 /* Trending.swift */; };
|
||||
A9A7A4592F69569100BB84C6 /* Pagination.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A4442F68360900BB84C6 /* Pagination.swift */; };
|
||||
A9A7A45A2F69569100BB84C6 /* Meta.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A4472F68361200BB84C6 /* Meta.swift */; };
|
||||
A9A7A45B2F69569100BB84C6 /* GifObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A4412F68360200BB84C6 /* GifObject.swift */; };
|
||||
A9A7A45C2F69569100BB84C6 /* GiphyImages.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A44D2F68383900BB84C6 /* GiphyImages.swift */; };
|
||||
A9A7A45D2F69569100BB84C6 /* GiphyUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A44A2F6837A800BB84C6 /* GiphyUser.swift */; };
|
||||
A9A7A45E2F6956B700BB84C6 /* StickerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EB2F5AFE1E00A57668 /* StickerType.swift */; };
|
||||
A9A7A45F2F69570200BB84C6 /* Gif.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30F12F5B004E00A57668 /* Gif.swift */; };
|
||||
A9A7A4682F6AA17C00BB84C6 /* Int.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A4672F6AA17C00BB84C6 /* Int.swift */; };
|
||||
A9A7A4692F6AA17C00BB84C6 /* Int.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A4672F6AA17C00BB84C6 /* Int.swift */; };
|
||||
A9B9A82E2EB2CCBE004C9245 /* StickerSlackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9B9A82C2EB2CCBE004C9245 /* StickerSlackTests.swift */; };
|
||||
A9B9A82F2EB2CCED004C9245 /* EmojiHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A949B1F72EA04F2300215164 /* EmojiHoarder.swift */; };
|
||||
A9B9A8302EB2CD0B004C9245 /* Emoji.swift in Sources */ = {isa = PBXBuildFile; fileRef = A924C3712EA9127200F20781 /* Emoji.swift */; };
|
||||
@@ -91,9 +78,6 @@
|
||||
A9BBC5182EB8FA4500FFE82F /* ViewModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */; };
|
||||
A9BBC5192EB8FA4500FFE82F /* ViewModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */; };
|
||||
A9BBC51A2EB8FA4500FFE82F /* ViewModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */; };
|
||||
A9BDEADE2F82BC93002798DF /* NoStickersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDEADD2F82BC93002798DF /* NoStickersView.swift */; };
|
||||
A9BDEADF2F82BC93002798DF /* NoStickersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDEADD2F82BC93002798DF /* NoStickersView.swift */; };
|
||||
A9BDEAE02F82BCB4002798DF /* NoStickersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDEADD2F82BC93002798DF /* NoStickersView.swift */; };
|
||||
A9BE30EC2F5AFE1E00A57668 /* StickerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EB2F5AFE1E00A57668 /* StickerType.swift */; };
|
||||
A9BE30EF2F5B004800A57668 /* GifHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EE2F5B004800A57668 /* GifHoarder.swift */; };
|
||||
A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EE2F5B004800A57668 /* GifHoarder.swift */; };
|
||||
@@ -109,24 +93,21 @@
|
||||
A9BE30FF2F5FA78E00A57668 /* Hoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30FD2F5FA47100A57668 /* Hoarder.swift */; };
|
||||
A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
|
||||
A9C172DD2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
|
||||
A9CD6C352EDDE22800B7F421 /* EmojiPackDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackDetailView.swift */; };
|
||||
A9CD6C362EDDE22800B7F421 /* EmojiPackDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackDetailView.swift */; };
|
||||
A9CD6C352EDDE22800B7F421 /* EmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */; };
|
||||
A9CD6C362EDDE22800B7F421 /* EmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */; };
|
||||
A9CD6C382EDDE37500B7F421 /* EmojiPackManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C372EDDE37500B7F421 /* EmojiPackManager.swift */; };
|
||||
A9CD6C392EDDE37500B7F421 /* EmojiPackManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C372EDDE37500B7F421 /* EmojiPackManager.swift */; };
|
||||
A9CD6C3A2EDDE6B500B7F421 /* EmojiPack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D15B892EB1142C00404792 /* EmojiPack.swift */; };
|
||||
A9CD6C3B2EDDE6B500B7F421 /* EmojiPack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D15B892EB1142C00404792 /* EmojiPack.swift */; };
|
||||
A9D15B8B2EB1142C00404792 /* EmojiPack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D15B892EB1142C00404792 /* EmojiPack.swift */; };
|
||||
A9D6A8212F7014AE00F198FB /* TestStructures.swift in Sources */ = {isa = PBXBuildFile; fileRef = A995D95A2F6EBBDD0043E5F5 /* TestStructures.swift */; };
|
||||
A9EB72392EB93FDB00658CEB /* EmojiTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72382EB93FDB00658CEB /* EmojiTableView.swift */; };
|
||||
A9EB72472EB948C400658CEB /* StickerRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72462EB948C400658CEB /* StickerRow.swift */; };
|
||||
A9EB72492EB948C400658CEB /* StickerRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72462EB948C400658CEB /* StickerRow.swift */; };
|
||||
A9EB724A2EB948E000658CEB /* EmojiTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72382EB93FDB00658CEB /* EmojiTableView.swift */; };
|
||||
A9EB72392EB93FDB00658CEB /* EmojiCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */; };
|
||||
A9EB72472EB948C400658CEB /* EmojiRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72462EB948C400658CEB /* EmojiRow.swift */; };
|
||||
A9EB72492EB948C400658CEB /* EmojiRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72462EB948C400658CEB /* EmojiRow.swift */; };
|
||||
A9EB724A2EB948E000658CEB /* EmojiCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */; };
|
||||
A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
|
||||
A9EB724D2EB94A6B00658CEB /* TrieTestingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB724C2EB94A6B00658CEB /* TrieTestingView.swift */; };
|
||||
A9EB724F2EB94A6B00658CEB /* TrieTestingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB724C2EB94A6B00658CEB /* TrieTestingView.swift */; };
|
||||
A9EB72502EB94FAD00658CEB /* StickerPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */; };
|
||||
A9EC46AD2F6D9E4600E066E6 /* Hoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30FD2F5FA47100A57668 /* Hoarder.swift */; };
|
||||
A9EC46AE2F6D9E5800E066E6 /* StickerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EB2F5AFE1E00A57668 /* StickerType.swift */; };
|
||||
A9EB72502EB94FAD00658CEB /* EmojiPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -185,7 +166,7 @@
|
||||
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>"; };
|
||||
A969D6932EA3E86500399C05 /* Messages.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Messages.framework; path = Library/Frameworks/Messages.framework; sourceTree = DEVELOPER_DIR; };
|
||||
A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerPreview.swift; sourceTree = "<group>"; };
|
||||
A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPreview.swift; sourceTree = "<group>"; };
|
||||
A986A6AD2EB658DF00B6E0FA /* StickerSlackiMessageApp.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = StickerSlackiMessageApp.appex; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A986A6C62EB659E000B6E0FA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
A986A6C72EB659E000B6E0FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
@@ -193,19 +174,15 @@
|
||||
A986A6CA2EB659E000B6E0FA /* MessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesViewController.swift; sourceTree = "<group>"; };
|
||||
A986A6CB2EB659E000B6E0FA /* StickerBrowserDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerBrowserDataSource.swift; sourceTree = "<group>"; };
|
||||
A99589AE2F5E0D83003A4A8C /* image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image.png; sourceTree = "<group>"; };
|
||||
A995D95A2F6EBBDD0043E5F5 /* TestStructures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestStructures.swift; sourceTree = "<group>"; };
|
||||
A9A7A43E2F6835F800BB84C6 /* Trending.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Trending.swift; sourceTree = "<group>"; };
|
||||
A9A7A4412F68360200BB84C6 /* GifObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifObject.swift; sourceTree = "<group>"; };
|
||||
A9A7A4442F68360900BB84C6 /* Pagination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pagination.swift; sourceTree = "<group>"; };
|
||||
A9A7A4472F68361200BB84C6 /* Meta.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Meta.swift; sourceTree = "<group>"; };
|
||||
A9A7A44A2F6837A800BB84C6 /* GiphyUser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiphyUser.swift; sourceTree = "<group>"; };
|
||||
A9A7A44D2F68383900BB84C6 /* GiphyImages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiphyImages.swift; sourceTree = "<group>"; };
|
||||
A9A7A4672F6AA17C00BB84C6 /* Int.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Int.swift; sourceTree = "<group>"; };
|
||||
A9B9A8232EB2CCB5004C9245 /* StickerSlackTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StickerSlackTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A9B9A82C2EB2CCBE004C9245 /* StickerSlackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerSlackTests.swift; sourceTree = "<group>"; };
|
||||
A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModifiers.swift; sourceTree = "<group>"; };
|
||||
A9BDEADD2F82BC93002798DF /* NoStickersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoStickersView.swift; sourceTree = "<group>"; };
|
||||
A9BDEAE12F82BFF8002798DF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
A9BE30EB2F5AFE1E00A57668 /* StickerType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerType.swift; sourceTree = "<group>"; };
|
||||
A9BE30EE2F5B004800A57668 /* GifHoarder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifHoarder.swift; sourceTree = "<group>"; };
|
||||
A9BE30F12F5B004E00A57668 /* Gif.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gif.swift; sourceTree = "<group>"; };
|
||||
@@ -213,12 +190,12 @@
|
||||
A9BE30F92F5B03F400A57668 /* Sticker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sticker.swift; sourceTree = "<group>"; };
|
||||
A9BE30FD2F5FA47100A57668 /* Hoarder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Hoarder.swift; sourceTree = "<group>"; };
|
||||
A9C172DB2EB8C9AC008A7885 /* Trie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Trie.swift; sourceTree = "<group>"; };
|
||||
A9CD6C342EDDE22800B7F421 /* EmojiPackDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPackDetailView.swift; sourceTree = "<group>"; };
|
||||
A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPackView.swift; sourceTree = "<group>"; };
|
||||
A9CD6C372EDDE37500B7F421 /* EmojiPackManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPackManager.swift; sourceTree = "<group>"; };
|
||||
A9D15B892EB1142C00404792 /* EmojiPack.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPack.swift; sourceTree = "<group>"; };
|
||||
A9E2ECD72EB74CE00038B2D6 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
|
||||
A9EB72382EB93FDB00658CEB /* EmojiTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiTableView.swift; sourceTree = "<group>"; };
|
||||
A9EB72462EB948C400658CEB /* StickerRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerRow.swift; sourceTree = "<group>"; };
|
||||
A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiCollectionView.swift; sourceTree = "<group>"; };
|
||||
A9EB72462EB948C400658CEB /* EmojiRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiRow.swift; sourceTree = "<group>"; };
|
||||
A9EB724C2EB94A6B00658CEB /* TrieTestingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrieTestingView.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@@ -267,8 +244,6 @@
|
||||
children = (
|
||||
A9104C7D2EB4022500D160EA /* MSSticker.swift */,
|
||||
A957C1762ECD008E00EA3EE9 /* Bundle.swift */,
|
||||
A9A7A4672F6AA17C00BB84C6 /* Int.swift */,
|
||||
A995D95A2F6EBBDD0043E5F5 /* TestStructures.swift */,
|
||||
);
|
||||
path = Extensions;
|
||||
sourceTree = "<group>";
|
||||
@@ -295,7 +270,9 @@
|
||||
A91C098C2EBBD7AB00210C34 /* Emoji */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9CD6C342EDDE22800B7F421 /* EmojiPackDetailView.swift */,
|
||||
A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */,
|
||||
A9EB72462EB948C400658CEB /* EmojiRow.swift */,
|
||||
A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */,
|
||||
);
|
||||
path = Emoji;
|
||||
sourceTree = "<group>";
|
||||
@@ -303,19 +280,15 @@
|
||||
A91C098D2EBBD7C100210C34 /* SwiftUI */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9A7A4602F69597000BB84C6 /* Gifs */,
|
||||
A949B1F02EA04E8200215164 /* ContentView.swift */,
|
||||
A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */,
|
||||
A91C098C2EBBD7AB00210C34 /* Emoji */,
|
||||
A921C2E12ED071C900E57B1A /* ListRow.swift */,
|
||||
A921C2DE2ED067BB00E57B1A /* WelcomeView.swift */,
|
||||
A9EB72462EB948C400658CEB /* StickerRow.swift */,
|
||||
A957C1732ECCE2CE00EA3EE9 /* SettingsView.swift */,
|
||||
A955B3F42EC22EE900E1732D /* SearchView.swift */,
|
||||
A955B3F02EC22E9700E1732D /* BrowseView.swift */,
|
||||
A9BDEADD2F82BC93002798DF /* NoStickersView.swift */,
|
||||
A955B3EC2EC22C4A00E1732D /* DownloadedView.swift */,
|
||||
A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */,
|
||||
A955B3F02EC22E9700E1732D /* BrowseView.swift */,
|
||||
A955B3F42EC22EE900E1732D /* SearchView.swift */,
|
||||
A957C1732ECCE2CE00EA3EE9 /* SettingsView.swift */,
|
||||
A921C2DE2ED067BB00E57B1A /* WelcomeView.swift */,
|
||||
A921C2E12ED071C900E57B1A /* ListRow.swift */,
|
||||
);
|
||||
path = SwiftUI;
|
||||
sourceTree = "<group>";
|
||||
@@ -323,7 +296,7 @@
|
||||
A91C098E2EBBD7C700210C34 /* UIKit */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9EB72382EB93FDB00658CEB /* EmojiTableView.swift */,
|
||||
A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */,
|
||||
);
|
||||
path = UIKit;
|
||||
sourceTree = "<group>";
|
||||
@@ -354,7 +327,6 @@
|
||||
A949B1F22EA04E8200215164 /* StickerSlack */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9BDEAE12F82BFF8002798DF /* Info.plist */,
|
||||
A9A7A4502F68447F00BB84C6 /* Models */,
|
||||
A924C3742EA9134C00F20781 /* StickerSlack.entitlements */,
|
||||
A949B1F12EA04E8200215164 /* StickerSlackApp.swift */,
|
||||
@@ -434,13 +406,6 @@
|
||||
path = Cachet;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9A7A4602F69597000BB84C6 /* Gifs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Gifs;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9B9A82D2EB2CCBE004C9245 /* StickerSlackTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -631,18 +596,16 @@
|
||||
A957C17F2ECFAA1100EA3EE9 /* GifView.swift in Sources */,
|
||||
A957C1742ECCE2CE00EA3EE9 /* SettingsView.swift in Sources */,
|
||||
A9A7A44B2F6837A800BB84C6 /* GiphyUser.swift in Sources */,
|
||||
A9EB72392EB93FDB00658CEB /* EmojiTableView.swift in Sources */,
|
||||
A9EB72392EB93FDB00658CEB /* EmojiCollectionView.swift in Sources */,
|
||||
A955B3EE2EC22C4A00E1732D /* DownloadedView.swift in Sources */,
|
||||
A949B1FB2EA0518800215164 /* SlackResponse.swift in Sources */,
|
||||
A957C17A2ECE542D00EA3EE9 /* GifManager.swift in Sources */,
|
||||
A9BDEADE2F82BC93002798DF /* NoStickersView.swift in Sources */,
|
||||
A955B3F52EC22EE900E1732D /* SearchView.swift in Sources */,
|
||||
A935437B2EB2A3C800BB80A4 /* FilterCategory.swift in Sources */,
|
||||
A9CD6C352EDDE22800B7F421 /* EmojiPackDetailView.swift in Sources */,
|
||||
A9CD6C352EDDE22800B7F421 /* EmojiPackView.swift in Sources */,
|
||||
A9A7A44E2F68383900BB84C6 /* GiphyImages.swift in Sources */,
|
||||
A9C172DD2EB8C9AC008A7885 /* Trie.swift in Sources */,
|
||||
A955B3F22EC22E9700E1732D /* BrowseView.swift in Sources */,
|
||||
A9A7A4692F6AA17C00BB84C6 /* Int.swift in Sources */,
|
||||
A9EB724F2EB94A6B00658CEB /* TrieTestingView.swift in Sources */,
|
||||
A924C3732EA9127200F20781 /* Emoji.swift in Sources */,
|
||||
A9D15B8B2EB1142C00404792 /* EmojiPack.swift in Sources */,
|
||||
@@ -651,14 +614,13 @@
|
||||
A921C2DF2ED067BB00E57B1A /* WelcomeView.swift in Sources */,
|
||||
A949B1F82EA04F2300215164 /* EmojiHoarder.swift in Sources */,
|
||||
A9BBC5182EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
|
||||
A9EB72492EB948C400658CEB /* StickerRow.swift in Sources */,
|
||||
A9EB72492EB948C400658CEB /* EmojiRow.swift in Sources */,
|
||||
A921C2E22ED071C900E57B1A /* ListRow.swift in Sources */,
|
||||
A9773C2F2EA54AF000F3B753 /* StickerPreview.swift in Sources */,
|
||||
A9773C2F2EA54AF000F3B753 /* EmojiPreview.swift in Sources */,
|
||||
A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */,
|
||||
A9BE30F22F5B004E00A57668 /* Gif.swift in Sources */,
|
||||
A9BE30EC2F5AFE1E00A57668 /* StickerType.swift in Sources */,
|
||||
A9A7A4482F68361200BB84C6 /* Meta.swift in Sources */,
|
||||
A995D95C2F6EBBDD0043E5F5 /* TestStructures.swift in Sources */,
|
||||
A9BE30FE2F5FA47100A57668 /* Hoarder.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -672,22 +634,11 @@
|
||||
A986A6C32EB6598100B6E0FA /* FilterCategory.swift in Sources */,
|
||||
A9CD6C3A2EDDE6B500B7F421 /* EmojiPack.swift in Sources */,
|
||||
A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */,
|
||||
A9BDEAE02F82BCB4002798DF /* NoStickersView.swift in Sources */,
|
||||
A9BE30FA2F5B03F400A57668 /* Sticker.swift in Sources */,
|
||||
A986A6CD2EB659E000B6E0FA /* MessagesViewController.swift in Sources */,
|
||||
A9A7A4572F69568700BB84C6 /* GifHoarder.swift in Sources */,
|
||||
A9BE30FF2F5FA78E00A57668 /* Hoarder.swift in Sources */,
|
||||
A9A7A4582F69569100BB84C6 /* Trending.swift in Sources */,
|
||||
A9A7A4592F69569100BB84C6 /* Pagination.swift in Sources */,
|
||||
A9A7A45A2F69569100BB84C6 /* Meta.swift in Sources */,
|
||||
A9A7A45B2F69569100BB84C6 /* GifObject.swift in Sources */,
|
||||
A9A7A45C2F69569100BB84C6 /* GiphyImages.swift in Sources */,
|
||||
A9A7A45D2F69569100BB84C6 /* GiphyUser.swift in Sources */,
|
||||
A986A6CE2EB659E000B6E0FA /* StickerBrowserDataSource.swift in Sources */,
|
||||
A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */,
|
||||
A9A7A45F2F69570200BB84C6 /* Gif.swift in Sources */,
|
||||
A9A7A45E2F6956B700BB84C6 /* StickerType.swift in Sources */,
|
||||
A9D6A8212F7014AE00F198FB /* TestStructures.swift in Sources */,
|
||||
A9BBC5192EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
|
||||
A986A6C42EB6598500B6E0FA /* SlackResponse.swift in Sources */,
|
||||
A986A6C22EB6597600B6E0FA /* Emoji.swift in Sources */,
|
||||
@@ -707,26 +658,21 @@
|
||||
A9A7A4402F6835F800BB84C6 /* Trending.swift in Sources */,
|
||||
A9BE30F72F5B011A00A57668 /* StickerProtocol.swift in Sources */,
|
||||
A9BE30FC2F5B03F400A57668 /* Sticker.swift in Sources */,
|
||||
A9EC46AE2F6D9E5800E066E6 /* StickerType.swift in Sources */,
|
||||
A9B9A82F2EB2CCED004C9245 /* EmojiHoarder.swift in Sources */,
|
||||
A9CD6C3B2EDDE6B500B7F421 /* EmojiPack.swift in Sources */,
|
||||
A921C2E32ED071C900E57B1A /* ListRow.swift in Sources */,
|
||||
A9BE30EF2F5B004800A57668 /* GifHoarder.swift in Sources */,
|
||||
A9A7A4492F68361200BB84C6 /* Meta.swift in Sources */,
|
||||
A9EB724A2EB948E000658CEB /* EmojiTableView.swift in Sources */,
|
||||
A9EB724A2EB948E000658CEB /* EmojiCollectionView.swift in Sources */,
|
||||
A9EB724D2EB94A6B00658CEB /* TrieTestingView.swift in Sources */,
|
||||
A9BBC51A2EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
|
||||
A995D95B2F6EBBDD0043E5F5 /* TestStructures.swift in Sources */,
|
||||
A955B3ED2EC22C4A00E1732D /* DownloadedView.swift in Sources */,
|
||||
A9EC46AD2F6D9E4600E066E6 /* Hoarder.swift in Sources */,
|
||||
A9A7A4682F6AA17C00BB84C6 /* Int.swift in Sources */,
|
||||
A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */,
|
||||
A957C1752ECCE2CE00EA3EE9 /* SettingsView.swift in Sources */,
|
||||
A9CD6C362EDDE22800B7F421 /* EmojiPackDetailView.swift in Sources */,
|
||||
A9EB72472EB948C400658CEB /* StickerRow.swift in Sources */,
|
||||
A9CD6C362EDDE22800B7F421 /* EmojiPackView.swift in Sources */,
|
||||
A9EB72472EB948C400658CEB /* EmojiRow.swift in Sources */,
|
||||
A9CD6C392EDDE37500B7F421 /* EmojiPackManager.swift in Sources */,
|
||||
A955B3F62EC22EE900E1732D /* SearchView.swift in Sources */,
|
||||
A9BDEADF2F82BC93002798DF /* NoStickersView.swift in Sources */,
|
||||
A9B9A8322EB2CD29004C9245 /* SlackResponse.swift in Sources */,
|
||||
A957C1782ECD008E00EA3EE9 /* Bundle.swift in Sources */,
|
||||
A921C2E02ED067BB00E57B1A /* WelcomeView.swift in Sources */,
|
||||
@@ -736,7 +682,7 @@
|
||||
A9A7A44C2F6837A800BB84C6 /* GiphyUser.swift in Sources */,
|
||||
A9B9A8312EB2CD14004C9245 /* FilterCategory.swift in Sources */,
|
||||
A957C1802ECFAA1100EA3EE9 /* GifView.swift in Sources */,
|
||||
A9EB72502EB94FAD00658CEB /* StickerPreview.swift in Sources */,
|
||||
A9EB72502EB94FAD00658CEB /* EmojiPreview.swift in Sources */,
|
||||
A9A7A4432F68360200BB84C6 /* GifObject.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -897,11 +843,9 @@
|
||||
DEVELOPMENT_TEAM = 8JGND254B7;
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_ON_DEMAND_RESOURCES = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_USER_SELECTED_FILES = readonly;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = StickerSlack/Info.plist;
|
||||
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
||||
@@ -918,8 +862,6 @@
|
||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 13;
|
||||
MARKETING_VERSION = "$(VERSION)";
|
||||
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "";
|
||||
ON_DEMAND_RESOURCES_PREFETCH_ORDER = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.StickerSlack;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
REGISTER_APP_GROUPS = YES;
|
||||
@@ -932,7 +874,7 @@
|
||||
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 6.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
XROS_DEPLOYMENT_TARGET = 1;
|
||||
};
|
||||
@@ -949,11 +891,9 @@
|
||||
DEVELOPMENT_TEAM = 8JGND254B7;
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_ON_DEMAND_RESOURCES = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_USER_SELECTED_FILES = readonly;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = StickerSlack/Info.plist;
|
||||
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
||||
@@ -970,8 +910,6 @@
|
||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 13;
|
||||
MARKETING_VERSION = "$(VERSION)";
|
||||
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "";
|
||||
ON_DEMAND_RESOURCES_PREFETCH_ORDER = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.StickerSlack;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
REGISTER_APP_GROUPS = YES;
|
||||
@@ -984,7 +922,7 @@
|
||||
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 6.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
XROS_DEPLOYMENT_TARGET = 1;
|
||||
};
|
||||
@@ -1017,7 +955,7 @@
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 6.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -1049,7 +987,7 @@
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 6.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -1072,7 +1010,7 @@
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 6.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StickerSlack.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/StickerSlack";
|
||||
};
|
||||
@@ -1095,7 +1033,7 @@
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 6.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StickerSlack.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/StickerSlack";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "2630"
|
||||
wasCreatedForAppExtension = "YES"
|
||||
version = "2.0">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES"
|
||||
buildArchitectures = "Automatic">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A986A6AC2EB658DF00B6E0FA"
|
||||
BuildableName = "StickerSlackiMessageApp.appex"
|
||||
BlueprintName = "StickerSlackiMessageApp"
|
||||
ReferencedContainer = "container:StickerSlack.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A949B1DE2EA04C0B00215164"
|
||||
BuildableName = "StickerSlack.app"
|
||||
BlueprintName = "StickerSlack"
|
||||
ReferencedContainer = "container:StickerSlack.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
shouldAutocreateTestPlan = "YES">
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = ""
|
||||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||
launchStyle = "0"
|
||||
askForAppToLaunch = "Yes"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES"
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A949B1DE2EA04C0B00215164"
|
||||
BuildableName = "StickerSlack.app"
|
||||
BlueprintName = "StickerSlack"
|
||||
ReferencedContainer = "container:StickerSlack.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
askForAppToLaunch = "Yes"
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A949B1DE2EA04C0B00215164"
|
||||
BuildableName = "StickerSlack.app"
|
||||
BlueprintName = "StickerSlack"
|
||||
ReferencedContainer = "container:StickerSlack.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -12,15 +12,22 @@ struct EmojiPack: Identifiable, Codable {
|
||||
var name: String
|
||||
var description: String
|
||||
var emojiNames: [String]
|
||||
}
|
||||
|
||||
extension EmojiPack {
|
||||
static func new() -> EmojiPack {
|
||||
|
||||
static var test: EmojiPack {
|
||||
EmojiPack(
|
||||
id: UUID(),
|
||||
name: "New Pack",
|
||||
description: "Emoji Pack at \(Date().formatted())",
|
||||
emojiNames: []
|
||||
name: "test pack",
|
||||
description: "neon443's debug emoji pack",
|
||||
emojiNames: [
|
||||
"pf",
|
||||
"heavysob",
|
||||
"yay",
|
||||
"skulk",
|
||||
"loll",
|
||||
"bleh",
|
||||
"uhh",
|
||||
"communist"
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -11,46 +11,9 @@ struct EmojiPackManager: View {
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
List {
|
||||
ForEach($hoarder.emojiPacks) { $pack in
|
||||
NavigationLink {
|
||||
EmojiPackDetailView(hoarder: hoarder, pack: $pack)
|
||||
} label: {
|
||||
Text(pack.name)
|
||||
}
|
||||
.swipeActions(edge: .trailing) {
|
||||
Button {
|
||||
withAnimation {
|
||||
hoarder.emojiPacks.removeAll { $0.id == pack.id }
|
||||
}
|
||||
} label: {
|
||||
Label("Delete", systemImage: "trash")
|
||||
}
|
||||
.tint(.red)
|
||||
}
|
||||
}
|
||||
NavigationLink {
|
||||
EmojiPackDetailView(hoarder: hoarder, pack: .constant(.test))
|
||||
} label: {
|
||||
Text("test")
|
||||
}
|
||||
}
|
||||
.navigationTitle("Emoji Packs")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem {
|
||||
Button {
|
||||
hoarder.emojiPacks.append(.new())
|
||||
} label: {
|
||||
Image(systemName: "plus")
|
||||
}
|
||||
.tint(.accentColor)
|
||||
.modifier(glassButtonIfAv())
|
||||
}
|
||||
}
|
||||
ForEach(hoarder.emojiPacks) { pack in
|
||||
EmojiPackView(hoarder: hoarder, pack: pack)
|
||||
}
|
||||
Divider()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,15 @@ import SwiftUI
|
||||
import Messages
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
@MainActor
|
||||
struct Emoji: StickerProtocol {
|
||||
var id: String
|
||||
var id: UUID
|
||||
var name: String
|
||||
var typeGlyph: String = "slack.logo"
|
||||
var localImageURLString: String {
|
||||
let urlString = remoteImageURL.absoluteString
|
||||
let split = urlString.split(separator: ".")
|
||||
let fileExtension = ".\(split.last ?? "png")"
|
||||
return EmojiHoarder.container.absoluteString+id.uuidString+fileExtension
|
||||
}
|
||||
var remoteImageURL: URL
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
@@ -26,7 +30,7 @@ struct Emoji: StickerProtocol {
|
||||
|
||||
init(from decoder: any Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.id = try container.decode(String.self, forKey: .id)
|
||||
self.id = try container.decode(UUID.self, forKey: .id)
|
||||
self.name = try container.decode(String.self, forKey: .name)
|
||||
self.remoteImageURL = try container.decode(URL.self, forKey: .remoteImageURL)
|
||||
}
|
||||
@@ -34,10 +38,20 @@ struct Emoji: StickerProtocol {
|
||||
init(
|
||||
name: String,
|
||||
url: URL,
|
||||
id: String = UUID().uuidString
|
||||
id: UUID = UUID()
|
||||
) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
self.remoteImageURL = url
|
||||
}
|
||||
|
||||
static var test: Emoji = Emoji(
|
||||
name: "a test slack emoji",
|
||||
url: Bundle.main.url(forResource: "image", withExtension: "png")!
|
||||
)
|
||||
|
||||
static var testLongName: Emoji = Emoji(
|
||||
name: "ForEach<Array<String>, String, EmojiRow>: the ID jarjarbinks occurs multiple times within the collection, this will give undefined results!",
|
||||
url: Bundle.main.url(forResource: "image", withExtension: "png")!
|
||||
)
|
||||
}
|
||||
@@ -11,18 +11,19 @@ import Combine
|
||||
import UniformTypeIdentifiers
|
||||
import Haptics
|
||||
|
||||
class EmojiHoarder: BaseHoarder {
|
||||
nonisolated static let container: URL = library.appendingPathComponent("Emojis", conformingTo: .directory)
|
||||
nonisolated static let localEmojiDB: URL = EmojiHoarder.library.appendingPathComponent("_____localEmojiDB.json", conformingTo: .fileURL)
|
||||
nonisolated static let localTrieDict: URL = EmojiHoarder.library.appendingPathComponent("_____localTrieDict.json", conformingTo: .fileURL)
|
||||
class EmojiHoarder: Hoarder, ObservableObject {
|
||||
static let container: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
||||
nonisolated static let localEmojiDB: URL = EmojiHoarder.container.appendingPathComponent("_localEmojiDB.json", conformingTo: .fileURL)
|
||||
nonisolated static let localTrie: URL = EmojiHoarder.container.appendingPathComponent("_localTrie.json", conformingTo: .fileURL)
|
||||
nonisolated static let localTrieDict: URL = EmojiHoarder.container.appendingPathComponent("_localTrieDict.json", conformingTo: .fileURL)
|
||||
let endpoint: URL = URL(string: "https://cachet.dunkirk.sh/emojis")!
|
||||
|
||||
@Published var emojis: [Emoji] = []
|
||||
@Published var emojiPacks: [EmojiPack] = [.test]
|
||||
@Published var emojiPacks: [EmojiPack] = []
|
||||
|
||||
@Published var trie: Trie = Trie()
|
||||
// @Published var downloadedStickers: Set<String> = []
|
||||
var downloadedStickersArr: [String] = []
|
||||
@Published var downloadedEmojis: Set<String> = []
|
||||
@Published var downloadedEmojisArr: [String] = []
|
||||
|
||||
@Published var letterStats: [EmojiHoarder.LetterStat] = []
|
||||
@Published var letterStatsSorting: EmojiHoarder.LetterStatSorting = .init(by: .letter, ascending: true)
|
||||
@@ -30,29 +31,18 @@ class EmojiHoarder: BaseHoarder {
|
||||
@Published var showWelcome: Bool = false
|
||||
|
||||
init(localOnly: Bool = false, skipIndex: Bool = false) {
|
||||
super.init()
|
||||
self.showWelcome = !UserDefaults.standard.bool(forKey: "showWelcome")
|
||||
|
||||
if !FileManager.default.fileExists(atPath: EmojiHoarder.container.path()) {
|
||||
try! FileManager.default.createDirectory(at: EmojiHoarder.container, withIntermediateDirectories: true)
|
||||
}
|
||||
|
||||
self.emojis = loadLocalDB()
|
||||
let localDB = loadLocalDB()
|
||||
withAnimation(.snappy) { self.emojis = localDB }
|
||||
loadTrie()
|
||||
if !skipIndex { buildTrie() }
|
||||
|
||||
startLoading(localOnly: localOnly, skipIndex: skipIndex)
|
||||
}
|
||||
|
||||
func startLoading(localOnly: Bool, skipIndex: Bool) {
|
||||
Task.detached {
|
||||
if !skipIndex { await self.buildTrie() }
|
||||
|
||||
guard !localOnly else { return }
|
||||
|
||||
guard !localOnly else { return }
|
||||
Task {
|
||||
print("start loading remote db")
|
||||
await self.loadRemoteDB()
|
||||
print("end")
|
||||
|
||||
if !skipIndex {
|
||||
await self.buildTrie()
|
||||
}
|
||||
@@ -62,6 +52,9 @@ class EmojiHoarder: BaseHoarder {
|
||||
@MainActor
|
||||
func downloadAllStickers() async {
|
||||
let start: Date = .now
|
||||
|
||||
downloadedEmojisArr = []
|
||||
|
||||
let cores = ProcessInfo.processInfo.processorCount-1
|
||||
var ranges: [Range<Int>] = []
|
||||
for i in 0..<cores {
|
||||
@@ -78,10 +71,11 @@ class EmojiHoarder: BaseHoarder {
|
||||
for range in ranges {
|
||||
group.addTask {
|
||||
for i in range {
|
||||
guard await !self.downloadedStickers.contains(await self.emojis[i].name) else { continue }
|
||||
await self.download(emoji: self.emojis[i], skipStoreIndex: true)
|
||||
let _ = await MainActor.run { self.downloadedStickers.insert(self.emojis[i].name) }
|
||||
if await i == self.emojis.count {
|
||||
await MainActor.run { self.downloadedEmojisArr.append(self.emojis[i].name) }
|
||||
guard !self.downloadedEmojis.contains(await self.emojis[i].name) else { continue }
|
||||
Task { await self.download(emoji: self.emojis[i], skipStoreIndex: true) }
|
||||
await MainActor.run { self.downloadedEmojis.insert(self.emojis[i].name) }
|
||||
if i == self.emojis.count {
|
||||
Task { @MainActor in
|
||||
self.storeDownloadedIndexes()
|
||||
}
|
||||
@@ -97,10 +91,11 @@ class EmojiHoarder: BaseHoarder {
|
||||
@MainActor
|
||||
func deleteAllStickers() {
|
||||
for i in emojis.indices {
|
||||
guard downloadedStickers.contains(emojis[i].name) else { continue }
|
||||
guard downloadedEmojis.contains(emojis[i].name) else { continue }
|
||||
delete(emoji: emojis[i], skipStoreIndex: true)
|
||||
}
|
||||
downloadedStickers = []
|
||||
downloadedEmojis = []
|
||||
downloadedEmojisArr = []
|
||||
storeDownloadedIndexes()
|
||||
}
|
||||
|
||||
@@ -113,14 +108,24 @@ class EmojiHoarder: BaseHoarder {
|
||||
trie.dict = [:]
|
||||
trie.wordlist = []
|
||||
try? FileManager.default.removeItem(at: EmojiHoarder.localEmojiDB)
|
||||
try? FileManager.default.removeItem(at: EmojiHoarder.localTrie)
|
||||
try? FileManager.default.removeItem(at: EmojiHoarder.localTrieDict)
|
||||
|
||||
downloadedStickers = []
|
||||
downloadedEmojis = []
|
||||
downloadedEmojisArr = []
|
||||
UserDefaults.standard.removeObject(forKey: "downloadedEmojis")
|
||||
UserDefaults.standard.removeObject(forKey: "downloadedEmojisArr")
|
||||
letterStats = []
|
||||
}
|
||||
|
||||
//cl i disabled ts cos its quicker to rebuild it then to load ts
|
||||
private func saveTrie() {
|
||||
// return
|
||||
// guard let data = try? encoder.encode(trie.root) else {
|
||||
// fatalError("failed to encode trie")
|
||||
// }
|
||||
// try! data.write(to: EmojiHoarder.localTrie)
|
||||
|
||||
guard let dataDict = try? encoder.encode(trie.dict) else {
|
||||
fatalError("failed to encode trie dict")
|
||||
}
|
||||
@@ -128,7 +133,15 @@ class EmojiHoarder: BaseHoarder {
|
||||
}
|
||||
|
||||
private func loadTrie() {
|
||||
guard FileManager.default.fileExists(atPath: EmojiHoarder.localTrieDict.path()) else { return }
|
||||
// return
|
||||
// guard FileManager.default.fileExists(atPath: EmojiHoarder.localTrie.path) else { return }
|
||||
// guard let data = try? Data(contentsOf: EmojiHoarder.localTrie) else { return }
|
||||
// guard let decoded = try? decoder.decode(TrieNode.self, from: data) else {
|
||||
// fatalError("failed to decode trie")
|
||||
// }
|
||||
// self.trie.root = decoded
|
||||
|
||||
guard FileManager.default.fileExists(atPath: EmojiHoarder.localTrieDict.path) else { return }
|
||||
guard let dataDict = try? Data(contentsOf: EmojiHoarder.localTrieDict) else { return }
|
||||
guard let decodedDict = try? decoder.decode([String:Emoji].self, from: dataDict) else {
|
||||
fatalError("failed to decode dict")
|
||||
@@ -136,34 +149,45 @@ class EmojiHoarder: BaseHoarder {
|
||||
self.trie.dict = decodedDict
|
||||
}
|
||||
|
||||
nonisolated
|
||||
func buildTrie() async {
|
||||
func buildTrie() {
|
||||
let start = Date().timeIntervalSince1970
|
||||
var wordlist = await trie.wordlist
|
||||
var dict = await trie.dict
|
||||
for emoji in await emojis {
|
||||
// trie.insert(word: emoji.name)
|
||||
wordlist.insert(emoji.name)
|
||||
dict[emoji.name] = emoji
|
||||
for emoji in emojis {
|
||||
trie.insert(word: emoji.name)
|
||||
}
|
||||
await trie.wordlist = wordlist
|
||||
await trie.dict = dict
|
||||
|
||||
await buildDownloadedStickers()
|
||||
await saveTrie()
|
||||
buildTrieDict()
|
||||
saveTrie()
|
||||
generateLetterStats()
|
||||
print("done building trie in", Date().timeIntervalSince1970-start)
|
||||
}
|
||||
|
||||
override func buildDownloadedStickers(for stickerType: String = "Emojis") async {
|
||||
await super.buildDownloadedStickers(for: stickerType)
|
||||
downloadedStickersArr = Array(downloadedStickers).sorted()
|
||||
private func buildTrieDict() {
|
||||
for emoji in emojis {
|
||||
trie.dict[emoji.name] = emoji
|
||||
}
|
||||
buildDownloadedEmojis()
|
||||
}
|
||||
|
||||
private func buildDownloadedEmojis() {
|
||||
downloadedEmojis = []
|
||||
downloadedEmojisArr = []
|
||||
downloadedEmojisArr = (try? decoder.decode([String].self, from: UserDefaults.standard.data(forKey: "downloadedEmojisArr") ?? Data())) ?? []
|
||||
downloadedEmojis = (try? decoder.decode(Set<String>.self, from: UserDefaults.standard.data(forKey: "downloadedEmojis") ?? Data())) ?? []
|
||||
|
||||
if downloadedEmojis.isEmpty || downloadedEmojisArr.isEmpty {
|
||||
for emoji in emojis {
|
||||
guard emoji.isLocal else { continue }
|
||||
downloadedEmojis.insert(emoji.name)
|
||||
downloadedEmojisArr.append(emoji.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func storeDownloadedIndexes() {
|
||||
UserDefaults.standard.set(try! encoder.encode(downloadedStickers), forKey: "downloadedEmojis")
|
||||
UserDefaults.standard.set(try! encoder.encode(downloadedEmojis), forKey: "downloadedEmojis")
|
||||
UserDefaults.standard.set(try! encoder.encode(downloadedEmojisArr), forKey: "downloadedEmojisArr")
|
||||
}
|
||||
|
||||
// nonisolated
|
||||
nonisolated
|
||||
private func loadLocalDB() -> [Emoji] {
|
||||
if let localEmojiDB = try? Data(contentsOf: EmojiHoarder.localEmojiDB) {
|
||||
let decoded = try! decoder.decode([Emoji].self, from: localEmojiDB)
|
||||
@@ -172,13 +196,10 @@ class EmojiHoarder: BaseHoarder {
|
||||
return []
|
||||
}
|
||||
|
||||
nonisolated
|
||||
private func loadRemoteDB() async {
|
||||
async let fetched = self.fetchRemoteDB()
|
||||
if let fetched = await fetched {
|
||||
await MainActor.run {
|
||||
withAnimation(.snappy) { self.emojis = fetched }
|
||||
}
|
||||
withAnimation(.snappy) { self.emojis = fetched }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +207,8 @@ class EmojiHoarder: BaseHoarder {
|
||||
private func fetchRemoteDB() async -> [Emoji]? {
|
||||
do {
|
||||
async let (data, _) = try URLSession.shared.data(from: endpoint)
|
||||
let decoded: [SlackResponse] = try await decoder.decode([SlackResponse].self, from: await data)
|
||||
decoder.dateDecodingStrategy = .iso8601
|
||||
let decoded: [SlackResponse] = try decoder.decode([SlackResponse].self, from: await data)
|
||||
try await storeDB(data: await data)
|
||||
return await SlackResponse.toEmojis(from: decoded)
|
||||
} catch {
|
||||
@@ -200,41 +222,41 @@ class EmojiHoarder: BaseHoarder {
|
||||
let local = loadLocalDB()
|
||||
await MainActor.run {
|
||||
emojis = local
|
||||
buildTrie()
|
||||
}
|
||||
await buildTrie()
|
||||
return
|
||||
}
|
||||
await MainActor.run {
|
||||
withAnimation(.snappy) { self.emojis = fetched }
|
||||
buildTrie()
|
||||
}
|
||||
await buildTrie()
|
||||
}
|
||||
|
||||
override nonisolated func download(emoji: any StickerProtocol, skipStoreIndex: Bool = false) async {
|
||||
await super.download(emoji: emoji, skipStoreIndex: skipStoreIndex)
|
||||
|
||||
// try? await emoji.downloadImage()
|
||||
nonisolated func download(emoji: Emoji, skipStoreIndex: Bool = false) async {
|
||||
try? await emoji.downloadImage()
|
||||
await MainActor.run {
|
||||
if !skipStoreIndex {
|
||||
let _ = withAnimation(.snappy) {
|
||||
self.downloadedStickers.insert(emoji.name)
|
||||
self.downloadedStickersArr.append(emoji.name)
|
||||
withAnimation(.snappy) {
|
||||
self.downloadedEmojis.insert(emoji.name)
|
||||
self.downloadedEmojisArr.append(emoji.name)
|
||||
}
|
||||
self.storeDownloadedIndexes()
|
||||
}
|
||||
if !skipStoreIndex { Haptic.success.trigger() }
|
||||
}
|
||||
}
|
||||
|
||||
override func delete(emoji: any StickerProtocol, skipStoreIndex: Bool = false) {
|
||||
super.delete(emoji: emoji, skipStoreIndex: skipStoreIndex)
|
||||
// emoji.deleteImage()
|
||||
@MainActor
|
||||
func delete(emoji: Emoji, skipStoreIndex: Bool = false) {
|
||||
emoji.deleteImage()
|
||||
if !skipStoreIndex {
|
||||
let _ = withAnimation(.snappy) {
|
||||
downloadedStickers.remove(emoji.name)
|
||||
downloadedStickersArr.removeAll(where: { $0 == emoji.name })
|
||||
withAnimation(.snappy) {
|
||||
downloadedEmojis.remove(emoji.name)
|
||||
downloadedEmojisArr.removeAll(where: { $0 == emoji.name })
|
||||
}
|
||||
storeDownloadedIndexes()
|
||||
}
|
||||
if !skipStoreIndex { Haptic.heavy.trigger() }
|
||||
}
|
||||
|
||||
func setShowWelcome(to newValue: Bool) {
|
||||
|
||||
@@ -12,8 +12,9 @@ class GifManager {
|
||||
//from clock-run, 12 frames one second
|
||||
static let defaultDuration: Double = 0.083333333333333329
|
||||
|
||||
static func gifFrom(url: URL) async throws -> [(frame: CGImage, showFor: Double)] {
|
||||
let (data, _) = try await URLSession.shared.data(from: url)
|
||||
static func gifFrom(url: URL) async -> [(frame: CGImage, showFor: Double)] {
|
||||
guard let (data, _) = try? await URLSession.shared.data(from: url) else { return [] }
|
||||
|
||||
return gifFrom(data: data)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,81 +16,47 @@ struct GifView: View {
|
||||
@State var currentI: Int = 0
|
||||
|
||||
@State var timer: Timer?
|
||||
@State var error: Error?
|
||||
@State var failed: Bool = false
|
||||
|
||||
func run() async {
|
||||
do {
|
||||
if gif.isEmpty {
|
||||
let frames = try await GifManager.gifFrom(url: url)
|
||||
withAnimation(.spring) {
|
||||
self.gif = frames
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
self.error = error
|
||||
}
|
||||
guard self.error == nil && !self.gif.isEmpty else {
|
||||
print("falied loading or empty gif")
|
||||
withAnimation(.spring) { self.failed = true }
|
||||
return
|
||||
}
|
||||
guard gif.count > 0 else { return }
|
||||
|
||||
if timer != nil {
|
||||
timer!.invalidate()
|
||||
timer = nil
|
||||
}
|
||||
|
||||
timer = Timer(timeInterval: gif[0].showFor, repeats: true) { timer in
|
||||
if currentI == (gif.count-1) {
|
||||
currentI = 0
|
||||
} else {
|
||||
currentI += 1
|
||||
}
|
||||
}
|
||||
RunLoop.main.add(timer!, forMode: .common)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
// /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Hello, world!@*/Text("Hello, world!")/*@END_MENU_TOKEN@*/
|
||||
TimelineView(.animation) { tl in
|
||||
VStack {
|
||||
if gif.isEmpty && error == nil {
|
||||
ProgressView()
|
||||
.controlSize(.large)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else if failed {
|
||||
Image(systemName: "xmark")
|
||||
if currentI < gif.count {
|
||||
let image = Image(uiImage: .init(cgImage: gif[currentI].frame))
|
||||
image
|
||||
.resizable().scaledToFit()
|
||||
.padding()
|
||||
.padding()
|
||||
.background(.red)
|
||||
} else {
|
||||
if currentI < gif.count {
|
||||
let image = Image(uiImage: .init(cgImage: gif[currentI].frame))
|
||||
image
|
||||
.resizable().scaledToFit()
|
||||
}
|
||||
}
|
||||
}
|
||||
.transition(.scale)
|
||||
}
|
||||
.onDisappear {
|
||||
timer?.invalidate()
|
||||
timer = nil
|
||||
}
|
||||
.task {
|
||||
await run()
|
||||
if gif.isEmpty {
|
||||
self.gif = await GifManager.gifFrom(url: url)
|
||||
}
|
||||
guard gif.count > 0 else { return }
|
||||
|
||||
if timer != nil {
|
||||
timer!.invalidate()
|
||||
timer = nil
|
||||
}
|
||||
|
||||
timer = Timer(timeInterval: gif[0].showFor, repeats: true) { timer in
|
||||
if currentI == (gif.count-1) {
|
||||
currentI = 0
|
||||
} else {
|
||||
currentI += 1
|
||||
}
|
||||
}
|
||||
RunLoop.main.add(timer!, forMode: .common)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
GifView(
|
||||
url: URL(string: "https://emoji.slack-edge.com/T09V59WQY1E/clockrun/f6641714fa6748ac.gif")!
|
||||
url: URL(string: "https://emoji.slack-edge.com/T0266FRGM/clockrun/ec33c513d30a6ed8.gif")!
|
||||
)
|
||||
GifView(url: Emoji.test.remoteImageURL)
|
||||
GifView(url: Emoji.testLongName.localImageURL)
|
||||
GifView(url: Gif.test.remoteImageURL)
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// Int.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 18/03/2026.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Int {
|
||||
var plural: String {
|
||||
return self == 1 ? "" : "s"
|
||||
}
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
//
|
||||
// TestStructures.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 21/03/2026.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
extension Emoji {
|
||||
static var test: Emoji = Emoji(
|
||||
name: "a test slack emoji",
|
||||
url: Bundle.main.url(forResource: "image", withExtension: "png")!
|
||||
)
|
||||
|
||||
static var testLongName: Emoji = Emoji(
|
||||
name: "ForEach<Array<String>, String, EmojiRow>: the ID jarjarbinks occurs multiple times within the collection, this will give undefined results!",
|
||||
url: Bundle.main.url(forResource: "image", withExtension: "png")!
|
||||
)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
extension Gif {
|
||||
static var test: Gif = GifObject(
|
||||
type: "gif",
|
||||
id: "XAeEGyCbp8UehBPkSA",
|
||||
slug: "know-does-he-XAeEGyCbp8UehBPkSA",
|
||||
url: "https://giphy.com/gifs/know-does-he-XAeEGyCbp8UehBPkSA",
|
||||
bitly_url: "https://gph.is/g/4AKMQlV",
|
||||
embed_url: "https://giphy.com/embed/XAeEGyCbp8UehBPkSA",
|
||||
username: "Ommarbisafool",
|
||||
source: "",
|
||||
rating: "g",
|
||||
source_tld: "",
|
||||
source_post_url: "",
|
||||
import_datetime: "2025-11-06 15:48:02",
|
||||
images: GiphyImages(
|
||||
fixed_height: .init(
|
||||
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200.gif&ct=g",
|
||||
width: "270",
|
||||
height: "200",
|
||||
size: "74672",
|
||||
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200.mp4&ct=g",
|
||||
mp4_size: "11433",
|
||||
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200.webp&ct=g",
|
||||
webp_size: "10962"
|
||||
),
|
||||
fixed_height_still: nil,
|
||||
fixed_height_downsampled: .init(
|
||||
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200_d.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200_d.gif&ct=g",
|
||||
width: "270",
|
||||
height: "200",
|
||||
size: "51332",
|
||||
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200_d.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200_d.webp&ct=g",
|
||||
webp_size: "44850"
|
||||
),
|
||||
fixed_height_small: .init(
|
||||
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100.gif&ct=g",
|
||||
width: "134",
|
||||
height: "100",
|
||||
size: "16461",
|
||||
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100.mp4&ct=g",
|
||||
mp4_size: "5340",
|
||||
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100.webp&ct=g",
|
||||
webp_size: "3142"
|
||||
),
|
||||
fixed_height_small_still: nil,
|
||||
fixed_width: .init(
|
||||
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w.gif&ct=g",
|
||||
width: "200",
|
||||
height: "148",
|
||||
size: "42579",
|
||||
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w.mp4&ct=g",
|
||||
mp4_size: "8158",
|
||||
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w.webp&ct=g",
|
||||
webp_size: "4458"
|
||||
),
|
||||
fixed_width_still: nil,
|
||||
fixed_width_downsampled: .init(
|
||||
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w_d.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w_d.gif&ct=g",
|
||||
width: "200",
|
||||
height: "148",
|
||||
size: "23483",
|
||||
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w_d.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w_d.webp&ct=g",
|
||||
webp_size: "22586"
|
||||
),
|
||||
fixed_width_small: .init(
|
||||
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100w.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100w.gif&ct=g",
|
||||
width: "100",
|
||||
height: "74",
|
||||
size: "8150",
|
||||
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100w.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100w.mp4&ct=g",
|
||||
mp4_size: "4103",
|
||||
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100w.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100w.webp&ct=g",
|
||||
webp_size: "1814"
|
||||
),
|
||||
fixed_width_small_still: nil,
|
||||
downsized: nil,
|
||||
downsized_still: nil,
|
||||
downsized_large: nil,
|
||||
downsized_medium: nil,
|
||||
downsized_small: nil,
|
||||
original: .init(
|
||||
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/giphy.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=giphy.gif&ct=g",
|
||||
width: "480",
|
||||
height: "356",
|
||||
size: "245829",
|
||||
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/giphy.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=giphy.mp4&ct=g",
|
||||
mp4_size: "23259",
|
||||
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/giphy.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=giphy.webp&ct=g",
|
||||
webp_size: "26984"
|
||||
),
|
||||
original_still: nil,
|
||||
// looping: nil,
|
||||
preview: nil,
|
||||
preview_gif: nil
|
||||
),
|
||||
title: "Know GIF",
|
||||
alt_text: "",
|
||||
is_low_contrast: false
|
||||
).toGif
|
||||
}
|
||||
|
||||
@MainActor
|
||||
extension EmojiPack {
|
||||
static var test: EmojiPack {
|
||||
EmojiPack(
|
||||
id: UUID(),
|
||||
name: "test pack",
|
||||
description: "neon443's debug emoji pack",
|
||||
emojiNames: [
|
||||
"pf",
|
||||
"heavysob",
|
||||
"yay",
|
||||
"skulk",
|
||||
"loll",
|
||||
"bleh",
|
||||
"uhh",
|
||||
"communist"
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
+36
-11
@@ -9,28 +9,53 @@ import Foundation
|
||||
import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
@MainActor
|
||||
struct Gif: StickerProtocol {
|
||||
var id: String
|
||||
var id: UUID
|
||||
var name: String
|
||||
var typeGlyph: String = "giphy.logo"
|
||||
var localImageURLString: String {
|
||||
let urlString = remoteImageURL.absoluteString
|
||||
let split = urlString.split(separator: ".")
|
||||
let fileExtension = ".\(split.last ?? "png")"
|
||||
|
||||
return EmojiHoarder.container.appendingPathComponent("gifs", conformingTo: .directory).absoluteString+id.uuidString+fileExtension
|
||||
}
|
||||
var remoteImageURL: URL
|
||||
|
||||
var giphyImages: GiphyImages?
|
||||
|
||||
// enum CodingKeys: String, CodingKey {
|
||||
//
|
||||
// }
|
||||
// enum CodingKeys: String, CodingKey {
|
||||
//
|
||||
// }
|
||||
|
||||
init(
|
||||
name: String,
|
||||
url: URL,
|
||||
giphyImages: GiphyImages?,
|
||||
id: String = UUID().uuidString
|
||||
id: UUID = UUID()
|
||||
) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
self.giphyImages = giphyImages
|
||||
self.remoteImageURL = url
|
||||
}
|
||||
|
||||
func downloadImage() async throws {
|
||||
if let data = try? Data(contentsOf: localImageURL),
|
||||
let _ = UIImage(data: data) {
|
||||
return
|
||||
}
|
||||
|
||||
var (data, _) = try await URLSession.shared.data(from: remoteImageURL)
|
||||
|
||||
if let uiImage = UIImage(data: data),
|
||||
let cgImage = uiImage.cgImage,
|
||||
!self.localImageURLString.contains(".gif"),
|
||||
cgImage.width < 300 || cgImage.height < 300 {
|
||||
data = resize(image: uiImage, to: CGSize(width: 300, height: 300)).pngData()!
|
||||
}
|
||||
|
||||
try! data.write(to: localImageURL)
|
||||
return
|
||||
}
|
||||
|
||||
static var test: Gif = Gif(
|
||||
name: "doesheknow",
|
||||
url: URL(string: "https://media1.tenor.com/m/FN9udnZmQU8AAAAd/does-he-know-batman.gif")!
|
||||
)
|
||||
}
|
||||
@@ -10,63 +10,39 @@ import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
import Combine
|
||||
|
||||
class GifHoarder: BaseHoarder {
|
||||
nonisolated static let container: URL = library.appendingPathComponent("Gifs", conformingTo: .directory)
|
||||
class GifHoarder: Hoarder, ObservableObject {
|
||||
static let container: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
||||
|
||||
static var apiKey: String = "a2mFsDTpX5blodY8ltkG6Q1xy5NgFSbc"
|
||||
static var apiKey: String = ""
|
||||
var endpoint: URL = URL(string: "https://api.giphy.com/v1/gifs/trending")!
|
||||
var endpointSearch: URL = URL(string: "https://api.giphy.com/v1/gifs/search")!
|
||||
|
||||
@Published var searchTerm: String = ""
|
||||
@Published var trendingGifs: [Gif] = []
|
||||
// @Published override var downloadedStickers: Set<String> = []
|
||||
|
||||
|
||||
func download(emoji: Emoji, skipStoreIndex: Bool) {
|
||||
// <#code#>
|
||||
}
|
||||
|
||||
func delete(emoji: Emoji, skipStoreIndex: Bool) {
|
||||
// <#code#>
|
||||
}
|
||||
|
||||
init(localOnly: Bool = false) {
|
||||
super.init()
|
||||
if !FileManager.default.fileExists(atPath: GifHoarder.container.path()) {
|
||||
try! FileManager.default.createDirectory(at: GifHoarder.container, withIntermediateDirectories: true)
|
||||
}
|
||||
startLoadingTrending()
|
||||
}
|
||||
|
||||
func startLoadingTrending() {
|
||||
var components = URLComponents(url: endpoint, resolvingAgainstBaseURL: false)
|
||||
components?.queryItems = [
|
||||
URLQueryItem(name: "api_key", value: GifHoarder.apiKey),
|
||||
URLQueryItem(name: "limit", value: "500")
|
||||
URLQueryItem(name: "limit", value: "100")
|
||||
]
|
||||
guard let finalURL = components?.url else { fatalError("invalid URL for request for trending gifs") }
|
||||
|
||||
Task {
|
||||
do {
|
||||
let (data, _) = try await URLSession.shared.data(from: finalURL)
|
||||
let object: Trending = try JSONDecoder().decode(Trending.self, from: data)
|
||||
guard object.meta.status == 200 else {
|
||||
fatalError("non ok status code")
|
||||
}
|
||||
trendingGifs = object.data.map { $0.toGif }
|
||||
async let (data, _) = try URLSession.shared.data(from: components!.url!)
|
||||
let object: Trending = try JSONDecoder().decode(Trending.self, from: await data)
|
||||
print(object.data.count)
|
||||
} catch {
|
||||
print(error)
|
||||
}
|
||||
await buildDownloadedStickers()
|
||||
}
|
||||
}
|
||||
|
||||
override func download(emoji: any StickerProtocol, skipStoreIndex: Bool = false) async {
|
||||
await super.download(emoji: emoji, skipStoreIndex: skipStoreIndex)
|
||||
let _ = withAnimation(.snappy) {
|
||||
downloadedStickers.insert(emoji.name)
|
||||
}
|
||||
}
|
||||
|
||||
override func delete(emoji: any StickerProtocol, skipStoreIndex: Bool = false) {
|
||||
super.delete(emoji: emoji, skipStoreIndex: skipStoreIndex)
|
||||
let _ = withAnimation(.snappy) {
|
||||
downloadedStickers.remove(emoji.name)
|
||||
}
|
||||
}
|
||||
|
||||
override func buildDownloadedStickers(for stickerType: String = "Gifs") async {
|
||||
await super.buildDownloadedStickers(for: stickerType)
|
||||
}
|
||||
}
|
||||
@@ -9,61 +9,18 @@ import Foundation
|
||||
import SwiftUI
|
||||
import Combine
|
||||
import UniformTypeIdentifiers
|
||||
import Haptics
|
||||
|
||||
protocol Hoarder: ObservableObject {
|
||||
static var library: URL { get }
|
||||
var downloadedStickers: Set<String> { get set }
|
||||
protocol Hoarder {
|
||||
static var container: URL { get }
|
||||
var endpoint: URL { get }
|
||||
var encoder: JSONEncoder { get }
|
||||
var decoder: JSONDecoder { get }
|
||||
|
||||
func download(emoji: any StickerProtocol, skipStoreIndex: Bool) async
|
||||
func delete(emoji: any StickerProtocol, skipStoreIndex: Bool)
|
||||
func download(emoji: Emoji, skipStoreIndex: Bool) async
|
||||
func delete(emoji: Emoji, skipStoreIndex: Bool)
|
||||
}
|
||||
|
||||
class BaseHoarder: Hoarder {
|
||||
nonisolated static let library: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
||||
|
||||
@Published var downloadedStickers: Set<String> = []
|
||||
|
||||
var encoder: JSONEncoder = JSONEncoder()
|
||||
var decoder: JSONDecoder = JSONDecoder()
|
||||
|
||||
func download(emoji: any StickerProtocol, skipStoreIndex: Bool) async {
|
||||
try? await emoji.downloadImage()
|
||||
await MainActor.run {
|
||||
Haptic.success.trigger()
|
||||
}
|
||||
}
|
||||
|
||||
func delete(emoji: any StickerProtocol, skipStoreIndex: Bool) {
|
||||
emoji.deleteImage()
|
||||
}
|
||||
|
||||
nonisolated func buildDownloadedStickers(for stickerType: String) async {
|
||||
if let data = UserDefaults.standard.data(forKey: "downloaded\(stickerType)"),
|
||||
let decoded = try? await decoder.decode(Set<String>.self, from: data) {
|
||||
await MainActor.run {
|
||||
downloadedStickers = decoded
|
||||
}
|
||||
} else {
|
||||
var newSet: Set<String> = []
|
||||
let url = BaseHoarder.library.appendingPathComponent(stickerType, conformingTo: .directory)
|
||||
if let files = try? FileManager.default.contentsOfDirectory(atPath: url.path()) {
|
||||
for file in files {
|
||||
let name = String(file.split(separator: ".")[0])
|
||||
newSet.insert(name)
|
||||
}
|
||||
}
|
||||
newSet.remove("DS_Store")
|
||||
let immutable = newSet
|
||||
await MainActor.run {
|
||||
self.downloadedStickers = []
|
||||
self.downloadedStickers = immutable
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
init() { }
|
||||
extension Hoarder {
|
||||
var encoder: JSONEncoder { JSONEncoder() }
|
||||
var decoder: JSONDecoder { JSONDecoder() }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>com.neon443.stickerslack</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>stickerslack</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -7,10 +7,9 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
struct SlackResponse: Identifiable, Codable {
|
||||
var type: String
|
||||
var id: String
|
||||
var id: UUID
|
||||
var name: String
|
||||
var imageUrl: String
|
||||
var alias: String?
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
struct GifObject: Codable, Identifiable {
|
||||
var type: String
|
||||
var id: String
|
||||
@@ -30,13 +29,4 @@ struct GifObject: Codable, Identifiable {
|
||||
var title: String
|
||||
var alt_text: String
|
||||
var is_low_contrast: Bool
|
||||
|
||||
var toGif: Gif {
|
||||
return Gif(
|
||||
name: self.title,
|
||||
url: URL(string: self.images.fixed_width.url)!,
|
||||
giphyImages: images,
|
||||
id: self.id
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -7,54 +7,54 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct GiphyImages: Codable, Equatable, Hashable {
|
||||
struct GiphyImages: Codable {
|
||||
//fixed height of 200px
|
||||
var fixed_height: motion
|
||||
//fixed height of 200px still
|
||||
var fixed_height_still: still?
|
||||
var fixed_height_still: still
|
||||
//fixed height 200px with 6 frames
|
||||
var fixed_height_downsampled: downsampled
|
||||
|
||||
//fixed height of 100px
|
||||
var fixed_height_small: motion
|
||||
//fixed height of 100px still
|
||||
var fixed_height_small_still: still?
|
||||
var fixed_height_small_still: still
|
||||
|
||||
//fixed width of 200px
|
||||
var fixed_width: motion
|
||||
//fixed width of 200px
|
||||
var fixed_width_still: still?
|
||||
var fixed_width_still: still
|
||||
//fixed width 200px with 6 frames
|
||||
var fixed_width_downsampled: downsampled
|
||||
|
||||
//fixed width of 100px
|
||||
var fixed_width_small: motion
|
||||
//fixed width of 100px still
|
||||
var fixed_width_small_still: still?
|
||||
var fixed_width_small_still: still
|
||||
|
||||
//under 2mb
|
||||
var downsized: downsized?
|
||||
var downsized: downsized
|
||||
//downsized still
|
||||
var downsized_still: still?
|
||||
var downsized_still: still
|
||||
//under 8mb
|
||||
var downsized_large: downsized?
|
||||
var downsized_large: downsized
|
||||
//under 5mb
|
||||
var downsized_medium: downsized?
|
||||
var downsized_medium: downsized
|
||||
//under 200kb
|
||||
var downsized_small: video?
|
||||
var downsized_small: video
|
||||
|
||||
var original: motion
|
||||
var original_still: still?
|
||||
var original_still: still
|
||||
|
||||
//15s looping version
|
||||
// var looping: looping?
|
||||
// var looping: looping
|
||||
//mp4 format 50kb, first 1-2s of the gif
|
||||
var preview: video?
|
||||
var preview: video
|
||||
//50kb first 1-2s of the gif
|
||||
var preview_gif: still?
|
||||
var preview_gif: still
|
||||
|
||||
|
||||
struct motion: Codable, Equatable, Hashable {
|
||||
struct motion: Codable {
|
||||
var url: String
|
||||
var width: String
|
||||
var height: String
|
||||
@@ -64,12 +64,12 @@ struct GiphyImages: Codable, Equatable, Hashable {
|
||||
var webp: String
|
||||
var webp_size: String
|
||||
}
|
||||
struct still: Codable, Equatable, Hashable {
|
||||
struct still: Codable {
|
||||
var url: String
|
||||
var width: String
|
||||
var height: String
|
||||
}
|
||||
struct downsampled: Codable, Equatable, Hashable {
|
||||
struct downsampled: Codable {
|
||||
var url: String
|
||||
var width: String
|
||||
var height: String
|
||||
@@ -77,16 +77,16 @@ struct GiphyImages: Codable, Equatable, Hashable {
|
||||
var webp: String
|
||||
var webp_size: String
|
||||
}
|
||||
struct downsized: Codable, Equatable, Hashable {
|
||||
struct downsized: Codable {
|
||||
var url: String
|
||||
var width: String
|
||||
var height: String
|
||||
var size: String
|
||||
}
|
||||
struct looping: Codable, Equatable, Hashable {
|
||||
struct looping: Codable {
|
||||
var mp4: String
|
||||
}
|
||||
struct video: Codable, Equatable, Hashable {
|
||||
struct video: Codable {
|
||||
var mp4: String
|
||||
var mp4_size: String
|
||||
var width: String
|
||||
|
||||
@@ -8,23 +8,34 @@
|
||||
import Foundation
|
||||
import Messages
|
||||
|
||||
nonisolated
|
||||
extension StickerProtocol {
|
||||
nonisolated var localImageURLString: String {
|
||||
let urlString = remoteImageURL.absoluteString
|
||||
let split = urlString.split(separator: ".")
|
||||
let fileExtension = ".\(split.last ?? "png")"
|
||||
|
||||
return GifHoarder.container.path()+name+"."+id+fileExtension
|
||||
var localImageURL: URL {
|
||||
return URL(string: localImageURLString)!
|
||||
}
|
||||
|
||||
nonisolated var localImageURL: URL {
|
||||
return URL(filePath: localImageURLString)
|
||||
var isLocal: Bool {
|
||||
return (try? Data(contentsOf: localImageURL)) != nil
|
||||
}
|
||||
|
||||
var msSticker: MSSticker? {
|
||||
guard isLocal else {
|
||||
return nil
|
||||
}
|
||||
return try? MSSticker(contentsOfFileURL: localImageURL, localizedDescription: name)
|
||||
}
|
||||
|
||||
var image: UIImage? {
|
||||
if let data = try? Data(contentsOf: localImageURL),
|
||||
let img = UIImage(data: data) {
|
||||
return img
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated
|
||||
func downloadImage() async throws {
|
||||
if let data = try? Data(contentsOf: localImageURL),
|
||||
if let data = try? await Data(contentsOf: localImageURL),
|
||||
let _ = UIImage(data: data) {
|
||||
return
|
||||
}
|
||||
@@ -33,23 +44,19 @@ extension StickerProtocol {
|
||||
|
||||
if let uiImage = UIImage(data: data),
|
||||
let cgImage = uiImage.cgImage,
|
||||
!self.localImageURLString.contains(".gif"),
|
||||
await !self.localImageURLString.contains(".gif"),
|
||||
cgImage.width < 300 || cgImage.height < 300 {
|
||||
data = resize(image: uiImage, to: CGSize(width: 300, height: 300)).pngData()!
|
||||
data = await resize(image: uiImage, to: CGSize(width: 300, height: 300)).pngData()!
|
||||
}
|
||||
try! data.write(to: localImageURL)
|
||||
try! await data.write(to: localImageURL)
|
||||
return
|
||||
}
|
||||
|
||||
nonisolated
|
||||
func deleteImage() {
|
||||
try? FileManager.default.removeItem(at: localImageURL)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
extension StickerProtocol {
|
||||
|
||||
func resize(image: UIImage, to targetSize: CGSize) -> UIImage {
|
||||
let oldSize = image.size
|
||||
let ratio: (x: CGFloat, y: CGFloat)
|
||||
@@ -80,21 +87,4 @@ extension StickerProtocol {
|
||||
image.draw(in: rect)
|
||||
return UIGraphicsGetImageFromCurrentImageContext() ?? UIImage()
|
||||
}
|
||||
|
||||
/*nonisolated*/ var msSticker: MSSticker? {
|
||||
guard FileManager.default.fileExists(atPath: localImageURLString) else {
|
||||
return nil
|
||||
}
|
||||
return try? MSSticker(contentsOfFileURL: localImageURL, localizedDescription: name)
|
||||
}
|
||||
|
||||
/*nonisolated*/ var image: UIImage? {
|
||||
if FileManager.default.fileExists(atPath: localImageURLString),
|
||||
let data = try? Data(contentsOf: localImageURL),
|
||||
let img = UIImage(data: data) {
|
||||
return img
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,22 +8,21 @@
|
||||
import Foundation
|
||||
import Messages
|
||||
|
||||
nonisolated
|
||||
protocol StickerProtocol: Codable, Identifiable, Hashable {
|
||||
nonisolated var id: String { get set }
|
||||
nonisolated var name: String { get set }
|
||||
var id: UUID { get set }
|
||||
var name: String { get set }
|
||||
|
||||
nonisolated var typeGlyph: String { get }
|
||||
var localImageURL: URL { get }
|
||||
var localImageURLString: String { get }
|
||||
var remoteImageURL: URL { get set }
|
||||
|
||||
nonisolated var localImageURL: URL { get }
|
||||
nonisolated var localImageURLString: String { get }
|
||||
nonisolated var remoteImageURL: URL { get set }
|
||||
var isLocal: Bool { get }
|
||||
|
||||
nonisolated var msSticker: MSSticker? { get }
|
||||
nonisolated var image: UIImage? { get }
|
||||
var msSticker: MSSticker? { get }
|
||||
var image: UIImage? { get }
|
||||
|
||||
nonisolated func downloadImage() async throws
|
||||
nonisolated func deleteImage()
|
||||
nonisolated func resize(image: UIImage, to targetSize: CGSize) -> UIImage
|
||||
nonisolated static var test: Self { get }
|
||||
func downloadImage() async throws
|
||||
func deleteImage()
|
||||
func resize(image: UIImage, to targetSize: CGSize) -> UIImage
|
||||
static var test: Self { get }
|
||||
}
|
||||
@@ -9,43 +9,29 @@ import SwiftUI
|
||||
|
||||
struct BrowseView: View {
|
||||
@State private var browseWhat: StickerType = .slackEmoji
|
||||
@ObservedObject var emojiHoarder: EmojiHoarder
|
||||
@ObservedObject var gifHoarder: GifHoarder
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
var body: some View {
|
||||
List {
|
||||
Picker("", selection: $browseWhat) {
|
||||
ForEach(StickerType.allCases) { type in
|
||||
Text(type.description).tag(type)
|
||||
ForEach(StickerType.allCases, id: \.self) { type in
|
||||
Text(type.description)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
.padding(.horizontal)
|
||||
Group {
|
||||
switch browseWhat {
|
||||
case .slackEmoji:
|
||||
EmojiTableView(
|
||||
hoarder: emojiHoarder,
|
||||
items: emojiHoarder.emojis.map { $0.name }
|
||||
)
|
||||
.ignoresSafeArea(.container, edges: .bottom)
|
||||
.id(emojiHoarder.emojis)
|
||||
case .giphyGifs:
|
||||
ScrollView {
|
||||
ForEach(gifHoarder.trendingGifs) { gif in
|
||||
StickerRow(hoarder: gifHoarder, sticker: gif)
|
||||
.listRowSeparator(.hidden)
|
||||
}
|
||||
}
|
||||
switch browseWhat {
|
||||
case .slackEmoji:
|
||||
ForEach(hoarder.emojis, id: \.self) { emoji in
|
||||
EmojiRow(hoarder: hoarder, emoji: emoji)
|
||||
.listRowSeparator(.hidden)
|
||||
}
|
||||
case .giphyGifs:
|
||||
Text("hi")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
BrowseView(
|
||||
emojiHoarder: EmojiHoarder(localOnly: true),
|
||||
gifHoarder: GifHoarder(localOnly: true)
|
||||
)
|
||||
BrowseView(hoarder: EmojiHoarder(localOnly: true))
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct ContentView: View {
|
||||
@ObservedObject var emojiHoarder: EmojiHoarder = EmojiHoarder()
|
||||
@ObservedObject var hoarder: EmojiHoarder = EmojiHoarder()
|
||||
@ObservedObject var gifhoarder: GifHoarder = GifHoarder()
|
||||
|
||||
var body: some View {
|
||||
@@ -17,52 +17,44 @@ struct ContentView: View {
|
||||
if #available(iOS 18, *) {
|
||||
TabView {
|
||||
Tab("Browse", systemImage: "square.grid.2x2.fill") {
|
||||
BrowseView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder)
|
||||
}
|
||||
|
||||
Tab("Packs", systemImage: "square.stack.3d.up.fill") {
|
||||
EmojiPackManager(hoarder: emojiHoarder)
|
||||
BrowseView(hoarder: hoarder)
|
||||
}
|
||||
|
||||
Tab("Downloaded", systemImage: "arrow.down.circle.fill") {
|
||||
DownloadedView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder)
|
||||
DownloadedView(hoarder: hoarder)
|
||||
}
|
||||
|
||||
Tab("Settings", systemImage: "gear") {
|
||||
SettingsView(hoarder: emojiHoarder)
|
||||
SettingsView(hoarder: hoarder)
|
||||
}
|
||||
|
||||
Tab(role: .search) {
|
||||
SearchView(hoarder: emojiHoarder)
|
||||
SearchView(hoarder: hoarder)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
TabView {
|
||||
BrowseView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder)
|
||||
BrowseView(hoarder: hoarder)
|
||||
.tabItem {
|
||||
Label("Browse", systemImage: "square.grid.2x2.fill")
|
||||
}
|
||||
EmojiPackManager(hoarder: emojiHoarder)
|
||||
.tabItem {
|
||||
Label("Packs", systemImage: "square.stack.3d.up.fill")
|
||||
}
|
||||
DownloadedView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder)
|
||||
DownloadedView(hoarder: hoarder)
|
||||
.tabItem {
|
||||
Label("Downloaded", systemImage: "arrow.down.circle.fill")
|
||||
}
|
||||
SettingsView(hoarder: emojiHoarder)
|
||||
SettingsView(hoarder: hoarder)
|
||||
.tabItem {
|
||||
Label("Setings", systemImage: "gear")
|
||||
}
|
||||
SearchView(hoarder: emojiHoarder)
|
||||
SearchView(hoarder: hoarder)
|
||||
.tabItem {
|
||||
Label("Search", systemImage: "magnifyingglass")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $emojiHoarder.showWelcome) {
|
||||
emojiHoarder.setShowWelcome(to: false)
|
||||
.sheet(isPresented: $hoarder.showWelcome) {
|
||||
hoarder.setShowWelcome(to: false)
|
||||
} content: {
|
||||
WelcomeView()
|
||||
}
|
||||
@@ -71,5 +63,5 @@ struct ContentView: View {
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContentView(emojiHoarder: EmojiHoarder(localOnly: false))
|
||||
ContentView(hoarder: EmojiHoarder(localOnly: false))
|
||||
}
|
||||
@@ -8,12 +8,10 @@
|
||||
import SwiftUI
|
||||
|
||||
struct DownloadedView: View {
|
||||
@ObservedObject var emojiHoarder: EmojiHoarder
|
||||
@ObservedObject var gifHoarder: GifHoarder
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
var isDark: Bool { colorScheme == .dark }
|
||||
@State var browseWhat: StickerType = .slackEmoji
|
||||
|
||||
var minColWidth: CGFloat { 75 }
|
||||
var spacing: CGFloat { 5 }
|
||||
@@ -26,28 +24,17 @@ struct DownloadedView: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Picker("", selection: $browseWhat) {
|
||||
ForEach(StickerType.allCases) { type in
|
||||
Text(type.description)
|
||||
.tag(type)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
if emojiHoarder.downloadedStickers.isEmpty && gifHoarder.downloadedStickers.isEmpty {
|
||||
NoStickersView()
|
||||
.padding()
|
||||
}
|
||||
GeometryReader { geo in
|
||||
ScrollView {
|
||||
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
|
||||
let layout = Array(repeating: col, count: columns)
|
||||
LazyVGrid(columns: layout, spacing: spacing) {
|
||||
ForEach(emojiHoarder.downloadedStickersArr, id: \.self) { name in
|
||||
if let emoji = emojiHoarder.trie.dict[name] {
|
||||
ForEach(hoarder.downloadedEmojisArr, id: \.self) { name in
|
||||
if let emoji = hoarder.trie.dict[name] {
|
||||
ZStack {
|
||||
Rectangle()
|
||||
.foregroundStyle(isDark ? .black : .white)
|
||||
StickerPreview(sticker: emoji)
|
||||
EmojiPreview(hoarder: hoarder, emoji: emoji)
|
||||
RoundedRectangle(cornerRadius: 15)
|
||||
.stroke(.gray, lineWidth: 1)
|
||||
}
|
||||
@@ -65,7 +52,7 @@ struct DownloadedView: View {
|
||||
ShareLink("Share", item: emoji.remoteImageURL, subject: nil, message: nil)
|
||||
Divider()
|
||||
Button("Delete", systemImage: "trash.fill", role: .destructive) {
|
||||
emojiHoarder.delete(emoji: emoji)
|
||||
hoarder.delete(emoji: emoji)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,8 +65,5 @@ struct DownloadedView: View {
|
||||
}
|
||||
|
||||
#Preview {
|
||||
DownloadedView(
|
||||
emojiHoarder: EmojiHoarder(localOnly: true),
|
||||
gifHoarder: GifHoarder(localOnly: true)
|
||||
)
|
||||
DownloadedView(hoarder: EmojiHoarder(localOnly: true))
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
//
|
||||
// EmojiPackView.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 01/12/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct EmojiPackDetailView: View {
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
@Binding var pack: EmojiPack
|
||||
@State var edit: Bool = false
|
||||
@State var editName: Bool = false
|
||||
@State var editDescription: Bool = false
|
||||
@State var showAdder: Bool = false
|
||||
|
||||
var minColWidth: CGFloat { 75 }
|
||||
var spacing: CGFloat { 10 }
|
||||
var col: GridItem {
|
||||
GridItem(
|
||||
.flexible(minimum: minColWidth, maximum: 100),
|
||||
spacing: spacing,
|
||||
alignment: .center
|
||||
)
|
||||
}
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
GeometryReader { geo in
|
||||
VStack {
|
||||
Button() {
|
||||
editName.toggle()
|
||||
} label: {
|
||||
Text(pack.name)
|
||||
.bold()
|
||||
.foregroundStyle(edit ? .blue : .primary)
|
||||
.font(.title)
|
||||
}
|
||||
.disabled(!edit)
|
||||
.alert("Edit Name", isPresented: $editName) {
|
||||
TextField("", text: $pack.name)
|
||||
}
|
||||
|
||||
Button() {
|
||||
editDescription.toggle()
|
||||
} label: {
|
||||
Text(pack.description)
|
||||
.foregroundStyle(edit ? .blue : .primary)
|
||||
}
|
||||
.disabled(!edit)
|
||||
.alert("Edit Description", isPresented: $editDescription) {
|
||||
TextField("", text: $pack.description)
|
||||
}
|
||||
|
||||
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
|
||||
let layout = Array(repeating: col, count: columns)
|
||||
LazyVGrid(columns: layout, spacing: spacing) {
|
||||
ForEach(pack.emojiNames, id: \.self) { name in
|
||||
let emoji = hoarder.trie.dict[name] ?? .test
|
||||
VStack {
|
||||
StickerPreview(sticker: emoji)
|
||||
Text(emoji.name)
|
||||
.multilineTextAlignment(.center)
|
||||
.font(.caption)
|
||||
Spacer()
|
||||
}
|
||||
.overlay(alignment: .topLeading) {
|
||||
if edit {
|
||||
Button(role: .destructive) {
|
||||
withAnimation {
|
||||
pack.emojiNames.removeAll { $0 == name }
|
||||
}
|
||||
} label: {
|
||||
Image(systemName: "minus.circle.fill")
|
||||
.resizable().scaledToFit()
|
||||
}
|
||||
.frame(maxWidth: 25)
|
||||
.padding(-10)
|
||||
}
|
||||
}
|
||||
}
|
||||
if edit {
|
||||
Button() {
|
||||
showAdder.toggle()
|
||||
} label: {
|
||||
VStack {
|
||||
Image(systemName: "plus.square.dashed")
|
||||
.resizable().scaledToFit()
|
||||
.foregroundStyle(.green.opacity(0.5))
|
||||
Text("Add")
|
||||
.multilineTextAlignment(.center)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.green.opacity(0.5))
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $showAdder) {
|
||||
SearchView(hoarder: hoarder, fromPackEditor: true) { selection in
|
||||
print(selection)
|
||||
withAnimation {
|
||||
pack.emojiNames.append(selection)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.vertical)
|
||||
|
||||
Text("\(pack.emojiNames.count) Emoji\(pack.emojiNames.count.plural)")
|
||||
.bold()
|
||||
.multilineTextAlignment(.center)
|
||||
}
|
||||
.padding()
|
||||
.navigationTitle(edit ? "Editing" : "Pack Details")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem() {
|
||||
Button(
|
||||
"",
|
||||
systemImage: edit ? "checkmark" : "pencil"
|
||||
) {
|
||||
withAnimation { edit.toggle() }
|
||||
}
|
||||
.modifier(glassButtonIfAv(edit))
|
||||
.tint(edit ? .blue : .primary)
|
||||
}
|
||||
if #available(iOS 19, *) {
|
||||
ToolbarSpacer()
|
||||
}
|
||||
ToolbarItem() {
|
||||
ShareLink(item: URL(string: "stickerslack://")!) {
|
||||
Image(systemName: "square.and.arrow.up")
|
||||
}
|
||||
}
|
||||
}
|
||||
.onDisappear {
|
||||
print("disappear")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 17, *)
|
||||
#Preview {
|
||||
@Previewable @State var pack: EmojiPack = .test
|
||||
EmojiPackDetailView(
|
||||
hoarder: EmojiHoarder(localOnly: true, skipIndex: false),
|
||||
pack: $pack
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// EmojiPackView.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 01/12/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct EmojiPackView: View {
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
@State var pack: EmojiPack
|
||||
|
||||
var body: some View {
|
||||
Text(pack.name)
|
||||
.bold()
|
||||
Text(pack.description)
|
||||
.foregroundStyle(.gray)
|
||||
ForEach(pack.emojiNames, id: \.self) { name in
|
||||
EmojiPreview(hoarder: hoarder, emoji: hoarder.trie.dict[name] ?? .test)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
EmojiPackView(
|
||||
hoarder: EmojiHoarder(localOnly: true, skipIndex: true),
|
||||
pack: .test
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// EmojiPreview.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 19/10/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct EmojiPreview: View {
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
@State var emoji: Emoji
|
||||
|
||||
@State var gifImage: Image?
|
||||
|
||||
var body: some View {
|
||||
if let image = emoji.image {
|
||||
GifView(url: emoji.localImageURL)
|
||||
} else {
|
||||
GifView(url: emoji.remoteImageURL)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ImageErrorView: View {
|
||||
var body: some View {
|
||||
Image(systemName: "xmark.app.fill")
|
||||
.resizable().scaledToFit()
|
||||
.padding()
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.foregroundStyle(.red)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
EmojiPreview(
|
||||
hoarder: EmojiHoarder(localOnly: true),
|
||||
emoji: Emoji.test
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// EmojiRow.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 03/11/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct EmojiRow: View {
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
@State var emoji: Emoji
|
||||
@State var showTooltip: Bool = false
|
||||
|
||||
var isLocal: Bool {
|
||||
return hoarder.downloadedEmojis.contains(emoji.name)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
EmojiPreview(hoarder: hoarder, emoji: emoji)
|
||||
.frame(width: 100, height: 100)
|
||||
.transition(.scale)
|
||||
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
Text(emoji.name)
|
||||
.font(.caption)
|
||||
.bold(isLocal)
|
||||
.foregroundColor(isLocal ? .green : .primary)
|
||||
.lineLimit(nil)
|
||||
.multilineTextAlignment(.leading)
|
||||
HStack(spacing: 5) {
|
||||
Button {
|
||||
showTooltip.toggle()
|
||||
} label: {
|
||||
Image("slack.logo")
|
||||
.resizable().scaledToFit()
|
||||
.frame(width: 20, height: 20)
|
||||
.foregroundStyle(.gray)
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
.alert("From Slack", isPresented: $showTooltip) {
|
||||
Button("Done") {}
|
||||
}
|
||||
if isLocal {
|
||||
Image(systemName: "arrow.down.circle.fill")
|
||||
.resizable().scaledToFit()
|
||||
.frame(width: 20, height: 20)
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.foregroundStyle(.gray)
|
||||
.transition(.scale)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(5)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 15)
|
||||
.foregroundStyle(.gray.opacity(0.1))
|
||||
.shadow(radius: 2)
|
||||
)
|
||||
|
||||
Spacer()
|
||||
|
||||
if isLocal {
|
||||
Button("", systemImage: "trash") {
|
||||
hoarder.delete(emoji: emoji)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.transition(.scale)
|
||||
} else {
|
||||
Button("", systemImage: "arrow.down.circle") {
|
||||
Task {
|
||||
await hoarder.download(emoji: emoji)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.transition(.scale)
|
||||
}
|
||||
}
|
||||
.padding(.leading, -1)
|
||||
.padding(.trailing, -9)
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 17, *)
|
||||
#Preview {
|
||||
@Previewable var hoarder = EmojiHoarder(localOnly: true)
|
||||
List {
|
||||
EmojiRow(hoarder: hoarder, emoji: .test)
|
||||
EmojiRow(hoarder: hoarder, emoji: .testLongName)
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "a", url: Emoji.test.remoteImageURL))
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "ab", url: Emoji.test.remoteImageURL))
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abc", url: Emoji.test.remoteImageURL))
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcd", url: Emoji.test.remoteImageURL))
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcde", url: Emoji.test.remoteImageURL))
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcdef", url: Emoji.test.remoteImageURL))
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcdefg", url: Emoji.test.remoteImageURL))
|
||||
EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcdefgh", url: Emoji.test.remoteImageURL))
|
||||
ForEach(hoarder.downloadedEmojisArr, id: \.self) { name in
|
||||
if let emoji = hoarder.trie.dict[name] {
|
||||
EmojiRow(hoarder: hoarder, emoji: emoji)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// NoStickersView.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 05/04/2026.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct NoStickersView: View {
|
||||
var body: some View {
|
||||
VStack(alignment: .center) {
|
||||
Image(systemName: "questionmark.app.dashed")
|
||||
.resizable().scaledToFit()
|
||||
.frame(width: 75, height: 75)
|
||||
Text("No Downloaded Stickers")
|
||||
.font(.title)
|
||||
.bold()
|
||||
Text("Download some Slack Emojis or GIFs to use in iMessage!")
|
||||
.foregroundStyle(.gray)
|
||||
.multilineTextAlignment(.center)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
NoStickersView()
|
||||
}
|
||||
@@ -12,93 +12,30 @@ struct SearchView: View {
|
||||
|
||||
@State private var currentSearch: Task<Void, Never>?
|
||||
@State var searchTerm: String = ""
|
||||
@State var previousSearches: [String] = []
|
||||
@State var searchResult: [String] = []
|
||||
|
||||
@State var stickerType: StickerType = .slackEmoji
|
||||
|
||||
@State var fromPackEditor: Bool = false
|
||||
@State var callback: ((String) -> Void) = { _ in }
|
||||
var minColWidth: CGFloat { 75 }
|
||||
var spacing: CGFloat { 10 }
|
||||
var col: GridItem {
|
||||
GridItem(
|
||||
.flexible(minimum: minColWidth, maximum: 100),
|
||||
spacing: spacing,
|
||||
alignment: .center
|
||||
)
|
||||
}
|
||||
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
if fromPackEditor {
|
||||
GeometryReader { geo in
|
||||
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
|
||||
let layout = Array(repeating: col, count: columns)
|
||||
ScrollView {
|
||||
LazyVGrid(columns: layout, spacing: spacing) {
|
||||
ForEach(searchResult, id: \.self) { name in
|
||||
let emoji = hoarder.trie.dict[name] ?? .test
|
||||
StickerPreview(sticker: emoji)
|
||||
.onTapGesture {
|
||||
callback(emoji.name)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
List(searchResult, id: \.self) { name in
|
||||
EmojiRow(hoarder: hoarder, emoji: hoarder.trie.dict[name]!)
|
||||
}
|
||||
}
|
||||
.onChange(of: searchTerm) { _ in
|
||||
if currentSearch != nil { currentSearch?.cancel() }
|
||||
currentSearch = Task.detached {
|
||||
let result = await hoarder.trie.search(for: searchTerm)
|
||||
await MainActor.run {
|
||||
withAnimation(.snappy) {
|
||||
searchResult = result
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Picker("", selection: $stickerType) {
|
||||
ForEach(StickerType.allCases) { type in
|
||||
Text(type.description).tag(type)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
switch stickerType {
|
||||
case .slackEmoji:
|
||||
EmojiTableView(hoarder: hoarder, items: searchResult)
|
||||
.id(searchResult)
|
||||
.ignoresSafeArea(edges: .bottom)
|
||||
case .giphyGifs:
|
||||
Text("uhh")
|
||||
}
|
||||
}
|
||||
}
|
||||
.searchable(text: $searchTerm)
|
||||
.onChange(of: searchTerm) { new in
|
||||
if currentSearch != nil { currentSearch?.cancel() }
|
||||
guard !searchTerm.isEmpty else {
|
||||
currentSearch?.cancel()
|
||||
searchResult = []
|
||||
previousSearches = []
|
||||
return
|
||||
}
|
||||
currentSearch = Task.detached {
|
||||
let result = await hoarder.trie.search(
|
||||
for: searchTerm,
|
||||
previousQuery: previousSearches.last,
|
||||
previousResult: Set(searchResult)
|
||||
)
|
||||
await MainActor.run {
|
||||
withAnimation(.snappy) {
|
||||
searchResult = result
|
||||
previousSearches.append(searchTerm)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
SearchView(
|
||||
hoarder: EmojiHoarder(localOnly: true),
|
||||
fromPackEditor: true
|
||||
) {
|
||||
print($0)
|
||||
}
|
||||
SearchView(hoarder: EmojiHoarder(localOnly: true))
|
||||
}
|
||||
@@ -6,7 +6,6 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct SettingsView: View {
|
||||
@ObservedObject var hoarder: EmojiHoarder
|
||||
@@ -47,51 +46,45 @@ struct SettingsView: View {
|
||||
|
||||
Section("Stats") {
|
||||
Text("\(hoarder.emojis.count) total Emoji")
|
||||
Text("\(hoarder.downloadedStickers.count) downloaded Emoji")
|
||||
if hoarder.downloadedStickers.count == hoarder.emojis.count {
|
||||
Text("\(hoarder.downloadedEmojis.count) downloaded Emoji")
|
||||
if hoarder.downloadedEmojis.count == hoarder.emojis.count {
|
||||
Text("🎉")
|
||||
.font(.largeTitle)
|
||||
.onTapGesture {
|
||||
Haptic.rigid.trigger()
|
||||
}
|
||||
}
|
||||
// NavigationLink {
|
||||
// List {
|
||||
// Picker(selection: $hoarder.letterStatsSorting.by) {
|
||||
// ForEach(EmojiHoarder.SortLetterStatsBy.allCases, id: \.self) { sortType in
|
||||
// Text(sortType.rawValue).tag(sortType)
|
||||
// }
|
||||
// } label: {
|
||||
// Label("Sort by", systemImage: "arrow.up.arrow.down")
|
||||
// }
|
||||
// .onChange(of: hoarder.letterStatsSorting.by) { _ in
|
||||
// hoarder.sortLetterStats(by: hoarder.letterStatsSorting)
|
||||
// }
|
||||
//
|
||||
// Picker(selection: $hoarder.letterStatsSorting.ascending) {
|
||||
// Text("Ascending").tag(true)
|
||||
// Text("Descending").tag(false)
|
||||
// } label: {
|
||||
// Label("Order", systemImage: "greaterthan")
|
||||
// }
|
||||
// .onChange(of: hoarder.letterStatsSorting.ascending) { _ in
|
||||
// hoarder.sortLetterStats(by: hoarder.letterStatsSorting)
|
||||
// }
|
||||
//
|
||||
// ForEach(hoarder.letterStats, id: \.self) { stat in
|
||||
// HStack {
|
||||
// Text("\(stat.char)")
|
||||
// Spacer()
|
||||
// Text("\(stat.count)")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// .onAppear {
|
||||
// hoarder.generateLetterStats()
|
||||
// }
|
||||
// } label: {
|
||||
// Label("Letter Stats", systemImage: "textformat")
|
||||
// }
|
||||
NavigationLink {
|
||||
List {
|
||||
Picker(selection: $hoarder.letterStatsSorting.by) {
|
||||
ForEach(EmojiHoarder.SortLetterStatsBy.allCases, id: \.self) { sortType in
|
||||
Text(sortType.rawValue).tag(sortType)
|
||||
}
|
||||
} label: {
|
||||
Label("Sort by", systemImage: "arrow.up.arrow.down")
|
||||
}
|
||||
.onChange(of: hoarder.letterStatsSorting.by) { _ in
|
||||
hoarder.sortLetterStats(by: hoarder.letterStatsSorting)
|
||||
}
|
||||
|
||||
Picker(selection: $hoarder.letterStatsSorting.ascending) {
|
||||
Text("Ascending").tag(true)
|
||||
Text("Descending").tag(false)
|
||||
} label: {
|
||||
Label("Order", systemImage: "greaterthan")
|
||||
}
|
||||
.onChange(of: hoarder.letterStatsSorting.ascending) { _ in
|
||||
hoarder.sortLetterStats(by: hoarder.letterStatsSorting)
|
||||
}
|
||||
|
||||
ForEach(hoarder.letterStats, id: \.self) { stat in
|
||||
HStack {
|
||||
Text("\(stat.char)")
|
||||
Spacer()
|
||||
Text("\(stat.count)")
|
||||
}
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Label("Letter Stats", systemImage: "textformat")
|
||||
}
|
||||
}
|
||||
|
||||
Button("Show Welcome", systemImage: "arrow.trianglehead.clockwise") {
|
||||
@@ -126,9 +119,7 @@ struct SettingsView: View {
|
||||
|
||||
Button("Reindex", systemImage: "list.bullet.clipboard", role: .destructive) {
|
||||
hoarder.resetAllIndexes()
|
||||
Task {
|
||||
await hoarder.buildTrie()
|
||||
}
|
||||
hoarder.buildTrie()
|
||||
}
|
||||
.foregroundStyle(.red)
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
//
|
||||
// EmojiPreview.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 19/10/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct StickerPreview: View {
|
||||
@State var sticker: any StickerProtocol
|
||||
@State var gifImage: Image?
|
||||
|
||||
var type: StickerType {
|
||||
let type = Swift.type(of: sticker)
|
||||
if type == Emoji.self {
|
||||
return .slackEmoji
|
||||
} else if type == Gif.self {
|
||||
return .giphyGifs
|
||||
} else {
|
||||
fatalError()
|
||||
}
|
||||
}
|
||||
var body: some View {
|
||||
if sticker.image != nil {
|
||||
//local
|
||||
GifView(url: sticker.localImageURL)
|
||||
} else {
|
||||
//remote
|
||||
if type == .slackEmoji {
|
||||
GifView(url: sticker.remoteImageURL)
|
||||
} else {
|
||||
let gif = sticker as! Gif
|
||||
if let giphyImages = gif.giphyImages,
|
||||
let preview_gif = giphyImages.preview_gif,
|
||||
let url = URL(string: preview_gif.url) {
|
||||
GifView(url: url)
|
||||
} else {
|
||||
GifView(url: gif.remoteImageURL)
|
||||
.overlay {
|
||||
Image(systemName:
|
||||
"square.arrowtriangle.4.outward")
|
||||
.resizable().scaledToFit()
|
||||
.foregroundStyle(.red)
|
||||
.background(.black)
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ImageErrorView: View {
|
||||
var body: some View {
|
||||
Image(systemName: "xmark.app.fill")
|
||||
.resizable().scaledToFit()
|
||||
.padding()
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.foregroundStyle(.red)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
VStack {
|
||||
StickerPreview(
|
||||
sticker: Emoji.test
|
||||
)
|
||||
StickerPreview(
|
||||
sticker: Gif.test
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
//
|
||||
// EmojiRow.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 03/11/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct StickerRow<T: Hoarder>: View {
|
||||
@ObservedObject var hoarder: T
|
||||
@State var sticker: any StickerProtocol
|
||||
@State var showTooltip: Bool = false
|
||||
|
||||
var isDownloaded: Bool {
|
||||
return hoarder.downloadedStickers.contains(sticker.name)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
StickerPreview(sticker: sticker)
|
||||
.frame(width: 100, height: 100)
|
||||
.transition(.scale)
|
||||
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
Text(sticker.name)
|
||||
.font(.caption)
|
||||
.bold(isDownloaded)
|
||||
.foregroundColor(isDownloaded ? .green : .primary)
|
||||
.lineLimit(nil)
|
||||
.multilineTextAlignment(.leading)
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
Button {
|
||||
showTooltip.toggle()
|
||||
} label: {
|
||||
Image(sticker.typeGlyph)
|
||||
.resizable().scaledToFit()
|
||||
.frame(maxHeight: 20)
|
||||
.foregroundStyle(.gray)
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
.alert("From Slack", isPresented: $showTooltip) {
|
||||
Button("Done") {}
|
||||
}
|
||||
if isDownloaded {
|
||||
Image(systemName: "arrow.down.circle.fill")
|
||||
.resizable().scaledToFit()
|
||||
.frame(width: 20, height: 20)
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.foregroundStyle(.gray)
|
||||
.transition(.scale)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(5)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 15)
|
||||
.foregroundStyle(.gray.opacity(0.2))
|
||||
)
|
||||
|
||||
Spacer()
|
||||
|
||||
if isDownloaded {
|
||||
Button("", systemImage: "trash") {
|
||||
hoarder.delete(emoji: sticker, skipStoreIndex: false)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.transition(.scale)
|
||||
} else {
|
||||
Button("", systemImage: "arrow.down.circle") {
|
||||
Task.detached {
|
||||
await hoarder.download(emoji: sticker, skipStoreIndex: false)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.transition(.scale)
|
||||
}
|
||||
}
|
||||
.padding(.leading, -1)
|
||||
.padding(.trailing, -9)
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 17, *)
|
||||
#Preview {
|
||||
@Previewable var hoarder = EmojiHoarder(localOnly: true)
|
||||
List {
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji.test)
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji.testLongName)
|
||||
StickerRow(hoarder: hoarder, sticker: Gif.test)
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "a", url: Emoji.test.remoteImageURL))
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "ab", url: Emoji.test.remoteImageURL))
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abc", url: Emoji.test.remoteImageURL))
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcd", url: Emoji.test.remoteImageURL))
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcde", url: Emoji.test.remoteImageURL))
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcdef", url: Emoji.test.remoteImageURL))
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcdefg", url: Emoji.test.remoteImageURL))
|
||||
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcdefgh", url: Emoji.test.remoteImageURL))
|
||||
}
|
||||
.listStyle(.plain)
|
||||
}
|
||||
@@ -27,23 +27,3 @@ struct tabViewActivationSearchActivation: ViewModifier {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct glassButtonIfAv: ViewModifier {
|
||||
var enabled: Bool
|
||||
|
||||
init(_ enabled: Bool = true) {
|
||||
self.enabled = enabled
|
||||
}
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
if enabled {
|
||||
if #available(iOS 19, *) {
|
||||
content.buttonStyle(.glassProminent)
|
||||
} else {
|
||||
content.buttonStyle(.borderedProminent)
|
||||
}
|
||||
} else {
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,26 +9,14 @@ import SwiftUI
|
||||
|
||||
struct WelcomeView: View {
|
||||
@Environment(\.dismiss) var dismiss
|
||||
@Environment(\.colorScheme) var colourScheme
|
||||
var isDark: Bool {
|
||||
return colourScheme == .dark
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
HStack {
|
||||
Image("icon\(isDark ? "-dark" : "")")
|
||||
.resizable().scaledToFit()
|
||||
.frame(maxWidth: 75)
|
||||
Spacer()
|
||||
Text("StickerSlack")
|
||||
.bold()
|
||||
.font(.largeTitle)
|
||||
.monospaced()
|
||||
Spacer()
|
||||
}
|
||||
.padding(.vertical, 20)
|
||||
.padding(.leading, 20)
|
||||
VStack {
|
||||
Text("StickerSlack")
|
||||
.bold()
|
||||
.font(.largeTitle)
|
||||
.monospaced()
|
||||
.padding()
|
||||
List {
|
||||
Section("How to use") {
|
||||
ListRow(number: 1, text: "Browse or search for an emoji")
|
||||
@@ -41,38 +29,31 @@ struct WelcomeView: View {
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
Spacer()
|
||||
Group {
|
||||
if #available(iOS 19, *) {
|
||||
Button() {
|
||||
dismiss()
|
||||
} label: {
|
||||
ContinueButtonView()
|
||||
}
|
||||
.buttonStyle(.glassProminent)
|
||||
} else {
|
||||
Button() {
|
||||
dismiss()
|
||||
} label: {
|
||||
ContinueButtonView()
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
if #available(iOS 19, *) {
|
||||
Button() {
|
||||
dismiss()
|
||||
} label: {
|
||||
Text("Continue")
|
||||
.font(.title)
|
||||
.bold()
|
||||
}
|
||||
.buttonStyle(.glassProminent)
|
||||
.padding(.bottom)
|
||||
} else {
|
||||
Button() {
|
||||
dismiss()
|
||||
} label: {
|
||||
Text("Continue")
|
||||
.font(.title)
|
||||
.bold()
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.padding(.bottom)
|
||||
}
|
||||
.padding(.bottom)
|
||||
.tint(.purple)
|
||||
.interactiveDismissDisabled()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct ContinueButtonView: View {
|
||||
var body: some View {
|
||||
Text("Continue")
|
||||
.font(.title)
|
||||
.bold()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
Color.gray.opacity(0.5)
|
||||
.ignoresSafeArea(.all)
|
||||
|
||||
@@ -9,23 +9,20 @@ import Foundation
|
||||
import SwiftUI
|
||||
import Combine
|
||||
|
||||
nonisolated
|
||||
class TrieNode: Codable {
|
||||
var children: [String: TrieNode] = [:]
|
||||
var isEndOfWord: Bool = false
|
||||
}
|
||||
|
||||
//nonisolated
|
||||
class Trie: ObservableObject {
|
||||
var root: TrieNode = TrieNode()
|
||||
var dict: [String:Emoji] = [:]
|
||||
|
||||
var wordlist: Set<String> = []
|
||||
// var previousSearchTerm
|
||||
var wordlist: [String] = []
|
||||
|
||||
func insert(word: String) {
|
||||
let word = word.lowercased()
|
||||
wordlist.insert(word)
|
||||
wordlist.append(word)
|
||||
var currentNode = root
|
||||
let indices = word.indices
|
||||
let last = indices.last
|
||||
@@ -44,17 +41,12 @@ class Trie: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func search(for query: String, previousQuery: String?, previousResult: Set<String>?) -> [String] {
|
||||
var result: Set<String> = wordlist
|
||||
if let previousQuery,
|
||||
let previousResult,
|
||||
query.hasPrefix(previousQuery) {
|
||||
result = previousResult
|
||||
}
|
||||
func search(for query: String) -> [String] {
|
||||
var result: [String] = wordlist
|
||||
for word in query.split(separator: " ") {
|
||||
result = result.filter { $0.localizedCaseInsensitiveContains(word) }
|
||||
}
|
||||
return Array(result).sorted()
|
||||
return result
|
||||
}
|
||||
|
||||
func search(exactly query: String) -> Bool {
|
||||
|
||||
@@ -37,7 +37,7 @@ struct TrieTestingView: View {
|
||||
case .contains:
|
||||
if searchTask != nil { searchTask?.cancel() }
|
||||
searchTask = Task.detached {
|
||||
let result = await hoarder.trie.search(for: searchTerm, previousQuery: nil, previousResult: nil)
|
||||
let result = await hoarder.trie.search(for: searchTerm)
|
||||
await MainActor.run {
|
||||
withAnimation(.snappy) { searchResults = result }
|
||||
print("testing: contains search complete")
|
||||
@@ -62,9 +62,7 @@ struct TrieTestingView: View {
|
||||
}
|
||||
Spacer()
|
||||
Button("add emojis!") {
|
||||
Task {
|
||||
await hoarder.buildTrie()
|
||||
}
|
||||
hoarder.buildTrie()
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
@@ -116,11 +114,11 @@ struct TrieTestingView: View {
|
||||
}
|
||||
|
||||
if uikit {
|
||||
EmojiTableView(hoarder: hoarder, items: searchResults)
|
||||
EmojiCollectionView(hoarder: hoarder, items: searchResults)
|
||||
.animation(.snappy, value: searchResults)
|
||||
} else {
|
||||
List(searchResults, id: \.self) { item in
|
||||
StickerRow(hoarder: hoarder, sticker: hoarder.trie.dict[item]!)
|
||||
EmojiRow(hoarder: hoarder, emoji: hoarder.trie.dict[item]!)
|
||||
}
|
||||
.animation(.snappy, value: searchResults)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// EmojiCollectionView.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 03/11/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct EmojiCollectionView: UIViewRepresentable {
|
||||
let hoarder: EmojiHoarder
|
||||
let items: [String]
|
||||
|
||||
func makeUIView(context: Context) -> UITableView {
|
||||
let tableView = UITableView()
|
||||
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
|
||||
tableView.dataSource = context.coordinator
|
||||
return tableView
|
||||
}
|
||||
|
||||
func updateUIView(_ uiView: UITableView, context: Context) {
|
||||
context.coordinator.hoarder = hoarder
|
||||
context.coordinator.items = items
|
||||
uiView.reloadData()
|
||||
}
|
||||
|
||||
func makeCoordinator() -> Coordinator {
|
||||
Coordinator(hoarder: hoarder, items: items)
|
||||
}
|
||||
|
||||
final class Coordinator: NSObject, UITableViewDataSource {
|
||||
var hoarder: EmojiHoarder
|
||||
var items: [String]
|
||||
|
||||
init(hoarder: EmojiHoarder, items: [String]) {
|
||||
self.hoarder = hoarder
|
||||
self.items = items
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return items.count
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let emojiName = items[indexPath.row]
|
||||
let emoji = hoarder.trie.dict[emojiName]!
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
|
||||
|
||||
cell.contentConfiguration = UIHostingConfiguration {
|
||||
EmojiRow(hoarder: hoarder, emoji: emoji)
|
||||
.id(emoji)
|
||||
}
|
||||
return cell
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
//class EmojiCell: UITableViewCell {
|
||||
// override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
// let l = UILabel()
|
||||
// l.text = "ifosa"
|
||||
// self.view = l
|
||||
// }
|
||||
//
|
||||
// required init?(coder: NSCoder) {
|
||||
// fatalError("init(coder:) has not been implemented")
|
||||
// }
|
||||
//}
|
||||
@@ -1,103 +0,0 @@
|
||||
//
|
||||
// EmojiTableView.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 03/11/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import Haptics
|
||||
|
||||
struct EmojiTableView: UIViewRepresentable {
|
||||
let hoarder: EmojiHoarder
|
||||
let items: [String]
|
||||
|
||||
func makeUIView(context: Context) -> UITableView {
|
||||
let tableView = context.coordinator as UITableViewController
|
||||
tableView.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
|
||||
tableView.tableView.dataSource = context.coordinator
|
||||
tableView.tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 50, right: 0)
|
||||
tableView.tableView.separatorStyle = .none
|
||||
return tableView.tableView
|
||||
}
|
||||
|
||||
func updateUIView(_ uiView: UITableView, context: Context) {
|
||||
context.coordinator.hoarder = hoarder
|
||||
context.coordinator.items = items
|
||||
uiView.reloadData()
|
||||
}
|
||||
|
||||
func makeCoordinator() -> Coordinator {
|
||||
Coordinator(hoarder: hoarder, items: items)
|
||||
}
|
||||
|
||||
final class Coordinator: UITableViewController {
|
||||
var hoarder: EmojiHoarder
|
||||
var items: [String]
|
||||
|
||||
init(hoarder: EmojiHoarder, items: [String]) {
|
||||
self.hoarder = hoarder
|
||||
self.items = items
|
||||
super.init(style: .insetGrouped)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return items.count
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
guard !hoarder.trie.dict.isEmpty else {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
|
||||
let spinner = UIActivityIndicatorView()
|
||||
spinner.startAnimating()
|
||||
spinner.style = .large
|
||||
spinner.frame = cell.frame
|
||||
spinner.autoresizingMask = .flexibleWidth
|
||||
cell.addSubview(spinner)
|
||||
tableView.reloadData()
|
||||
return cell
|
||||
}
|
||||
let emojiName = items[indexPath.row]
|
||||
let emoji = hoarder.trie.dict[emojiName]!
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
|
||||
|
||||
cell.selectedBackgroundView = nil
|
||||
cell.selectionStyle = .none
|
||||
cell.contentConfiguration = UIHostingConfiguration {
|
||||
StickerRow(hoarder: hoarder, sticker: emoji)
|
||||
.id(emoji)
|
||||
}
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
// <#code#>
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
|
||||
// <#code#>
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, shouldBeginMultipleSelectionInteractionAt indexPath: IndexPath) -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
//class EmojiCell: UITableViewCell {
|
||||
// override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
// let l = UILabel()
|
||||
// l.text = "ifosa"
|
||||
// self.view = l
|
||||
// }
|
||||
//
|
||||
// required init?(coder: NSCoder) {
|
||||
// fatalError("init(coder:) has not been implemented")
|
||||
// }
|
||||
//}
|
||||
@@ -24,8 +24,7 @@
|
||||
{
|
||||
"name" : "PerformanceTests",
|
||||
"testFunctions" : [
|
||||
"downloadAll()",
|
||||
"fakeDownloadAllStickers()"
|
||||
"downloadAll()"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -14,21 +14,27 @@ struct StickerSlackTests {
|
||||
@Test func MSStickerValidation() async throws {
|
||||
let goodEmoji = Emoji(
|
||||
name: "name",
|
||||
url: URL(string: "https://neon443.xyz/images/fav.ico")!,
|
||||
id: "0c48f4c3-1c63-41ed-96db-909e50e35dfc"
|
||||
url: URL(string: "https://neon443.github.io/images/fav.ico")!,
|
||||
id: UUID(uuidString: "0c48f4c3-1c63-41ed-96db-909e50e35dfc")!
|
||||
)
|
||||
try! await goodEmoji.downloadImage()
|
||||
#expect(goodEmoji.msSticker!.validate(), "should be true")
|
||||
#expect(goodEmoji.sticker!.validate(), "should be true")
|
||||
|
||||
let badEmoji = Emoji(
|
||||
name: "160chars:shttps://emoji.slack-edge.com/T0266FRGM/100906/ddeb22d813b83b0f.pngs,sexpirationfds2025-10-28T08:00:02.011Zs},{gtypeh:jemojieeeidggg9cab2003-ad74-492a-",
|
||||
url: URL(string: "https://files.catbox.moe/ifh710.png")!,
|
||||
id: "0c48f4c3-1c63-41ed-96db-909e50e35dfc"
|
||||
id: UUID(uuidString: "0c48f4c3-1c63-41ed-96db-909e50e35dfc")!
|
||||
)
|
||||
try! await badEmoji.downloadImage()
|
||||
#expect(goodEmoji.msSticker!.validate(), "should be true")
|
||||
#expect(goodEmoji.sticker!.validate(), "should be true")
|
||||
badEmoji.deleteImage()
|
||||
}
|
||||
|
||||
@Test func deleteAllEmojis() async throws {
|
||||
let performanceTests = PerformanceTests(hoarder: .shared)
|
||||
try! await performanceTests.fakeDownloadAllStickers()
|
||||
await hoarder.deleteAllStickers()
|
||||
}
|
||||
}
|
||||
|
||||
struct PerformanceTests {
|
||||
@@ -37,7 +43,7 @@ struct PerformanceTests {
|
||||
@Test func stickerConversion() async throws {
|
||||
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
|
||||
for emoji in hoarder.emojis {
|
||||
let _ = emoji.msSticker
|
||||
let _ = emoji.sticker
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +53,16 @@ struct PerformanceTests {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@Test func filteringEmojis() async throws {
|
||||
let searchQueries = ["heavysob", "yay", "afsdjk", "afhjskf", "g4", "aqua-osx", "neotunes", "", "", ""]
|
||||
for query in searchQueries {
|
||||
print(query)
|
||||
hoarder.filteredEmojis = []
|
||||
hoarder.filterEmojis(by: query)
|
||||
print(hoarder.filteredEmojis.count)
|
||||
}
|
||||
}
|
||||
|
||||
@Test func downloadAll() async throws {
|
||||
let downloadedEmojisBefore = hoarder.emojis.filter { $0.isLocal }.map { $0.id }
|
||||
|
||||
@@ -84,14 +99,13 @@ struct PerformanceTests {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
func doThing(on emoji: Emoji, i: inout Int) async throws {
|
||||
do {
|
||||
guard !emoji.isLocal else { return }
|
||||
async let (data, _) = try URLSession.shared.data(from: emoji.remoteImageURL)
|
||||
try! await data.write(to: emoji.localImageURL)
|
||||
let _ = emoji.msSticker?.validate()
|
||||
let _ = emoji.sticker?.validate()
|
||||
i+=1
|
||||
print("\(i)/\(hoarder.emojis.count) \(emoji.name)")
|
||||
} catch {
|
||||
@@ -99,66 +113,43 @@ struct PerformanceTests {
|
||||
}
|
||||
}
|
||||
|
||||
// @Test func fakeDownloadAllStickers() async throws {
|
||||
// await withDiscardingTaskGroup { group in
|
||||
// for emoji in hoarder.emojis {
|
||||
// group.addTask {
|
||||
// try! Data().write(to: emoji.localImageURL)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@Test func fakeDownloadAllStickers() async throws {
|
||||
await withDiscardingTaskGroup { group in
|
||||
for emoji in hoarder.emojis {
|
||||
group.addTask {
|
||||
try! Data().write(to: emoji.localImageURL)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test func deleteAllImages() async throws {
|
||||
// try! await fakeDownloadAllStickers()
|
||||
try! await fakeDownloadAllStickers()
|
||||
await hoarder.deleteAllStickers()
|
||||
}
|
||||
|
||||
@Test func buildTrie() async throws {
|
||||
hoarder.resetAllIndexes()
|
||||
hoarder.resetTrie()
|
||||
hoarder.buildTrie()
|
||||
}
|
||||
|
||||
@Test func testSearching() async throws {
|
||||
try! await buildTrie()
|
||||
let terms = ["h", "j", "s", "2", "heavysob", "hs", "asjasdklf", "a", "w", "t", "h", "z", "b", "c", "m", "n"]
|
||||
for term in terms {
|
||||
let _ = hoarder.trie.search(prefix: term)
|
||||
}
|
||||
}
|
||||
|
||||
@Test func testIsLocal() async throws {
|
||||
for emoji in hoarder.emojis {
|
||||
let x = emoji.isLocal
|
||||
}
|
||||
}
|
||||
|
||||
@Test func testDownloadedEmojis() async throws {
|
||||
for emoji in hoarder.emojis {
|
||||
let x = hoarder.downloadedStickers.contains(emoji.name)
|
||||
}
|
||||
}
|
||||
|
||||
@Test func testSearching() async throws {
|
||||
try await testSearchingExactly()
|
||||
try await testSearchingFor()
|
||||
try await testSearchingPrefixes()
|
||||
}
|
||||
@Test func testSearchingFor() async throws {
|
||||
let queries = hoarder.emojis.choose(10_000).map { $0.name }
|
||||
for query in queries {
|
||||
let _ = hoarder.trie.search(for: query, previousQuery: nil, previousResult: nil)
|
||||
}
|
||||
}
|
||||
@Test func testSearchingExactly() async throws {
|
||||
let queries = hoarder.emojis.choose(10_000).map { $0.name }
|
||||
for query in queries {
|
||||
let _ = hoarder.trie.search(exactly: query)
|
||||
}
|
||||
}
|
||||
@Test func testSearchingPrefixes() async throws {
|
||||
let queries = hoarder.emojis.choose(10_000).map { $0.name }
|
||||
for query in queries {
|
||||
let _ = hoarder.trie.search(prefix: query)
|
||||
let x = hoarder.downloadedEmojis.contains(emoji.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Array {
|
||||
func choose(_ x: Int) -> Self {
|
||||
var x = x
|
||||
var result: Self = []
|
||||
while x != 0 {
|
||||
guard let randElement = self.randomElement() else { continue }
|
||||
result.append(randElement)
|
||||
x-=1
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import UIKit
|
||||
import Messages
|
||||
import SwiftUI
|
||||
|
||||
class MessagesViewController: MSMessagesAppViewController {
|
||||
let dataSource: StickerBrowserDataSource = StickerBrowserDataSource()
|
||||
@@ -25,37 +24,6 @@ class MessagesViewController: MSMessagesAppViewController {
|
||||
stickerBrowser.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height)
|
||||
stickerBrowser.dataSource = dataSource
|
||||
stickerBrowser.autoresizingMask = [.flexibleWidth]
|
||||
|
||||
guard stickerBrowser.dataSource?.numberOfStickers(in: stickerBrowser) != 0 else {
|
||||
let swiftUIView = NoStickersView()
|
||||
let hostingController = UIHostingController(rootView: swiftUIView)
|
||||
addChild(hostingController)
|
||||
hostingController.view.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(hostingController.view)
|
||||
hostingController.didMove(toParent: self)
|
||||
|
||||
let link = UIButton()
|
||||
link.setTitle("Open StickerSlack", for: .normal)
|
||||
link.setImage(UIImage(systemName: "arrow.up.right.square"), for: .normal)
|
||||
link.setTitleColor(.systemBlue, for: .normal)
|
||||
link.frame = view.frame
|
||||
link.translatesAutoresizingMaskIntoConstraints = false
|
||||
link.addTarget(self, action: #selector(openStickerSlack), for: .touchUpInside)
|
||||
view.addSubview(link)
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
hostingController.view.centerXAnchor.constraint(equalTo: view.centerXAnchor),
|
||||
hostingController.view.centerYAnchor.constraint(equalTo: view.centerYAnchor),
|
||||
hostingController.view.widthAnchor.constraint(equalTo: view.widthAnchor),
|
||||
hostingController.view.heightAnchor.constraint(equalTo: view.heightAnchor),
|
||||
link.centerXAnchor.constraint(equalTo: view.centerXAnchor),
|
||||
link.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
|
||||
link.heightAnchor.constraint(equalToConstant: 50)
|
||||
])
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
view.addSubview(stickerBrowser)
|
||||
stickerBrowser.reloadData()
|
||||
view.bringSubviewToFront(stickerBrowser)
|
||||
@@ -105,12 +73,4 @@ class MessagesViewController: MSMessagesAppViewController {
|
||||
// Use this method to finalize any behaviors associated with the change in presentation style.
|
||||
}
|
||||
|
||||
@objc
|
||||
func openStickerSlack() {
|
||||
if let url = URL(string: "stickerslack://") {
|
||||
self.extensionContext?.open(url) { success in
|
||||
print("open url: \(success)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,40 +11,18 @@ import Messages
|
||||
class StickerBrowserDataSource: NSObject, MSStickerBrowserViewDataSource {
|
||||
var hoarder: EmojiHoarder = EmojiHoarder(localOnly: true, skipIndex: true)
|
||||
|
||||
var msStickers: [MSSticker] = []
|
||||
var emojis: [Emoji] = []
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
msStickers = []
|
||||
guard let files = try? FileManager.default.contentsOfDirectory(atPath: EmojiHoarder.container.path()) else { return }
|
||||
|
||||
for file in files {
|
||||
guard file.contains(".png") ||
|
||||
file.contains(".jpg") ||
|
||||
file.contains(".gif") else { continue }
|
||||
let name = String(file.split(separator: ".")[0])
|
||||
if let emoji = hoarder.trie.dict[name],
|
||||
let msSticker = emoji.msSticker {
|
||||
msStickers.append(msSticker)
|
||||
} else {
|
||||
print(
|
||||
"name, emoji has value, mssticker has value:",
|
||||
name,
|
||||
hoarder.trie.dict[name] != nil,
|
||||
hoarder.trie.dict[name]?.msSticker != nil
|
||||
)
|
||||
}
|
||||
}
|
||||
print(msStickers.count, "init")
|
||||
}
|
||||
var emojis: [MSSticker] = []
|
||||
|
||||
func numberOfStickers(in stickerBrowserView: MSStickerBrowserView) -> Int {
|
||||
print(msStickers.count, "numberofstickers")
|
||||
return msStickers.count
|
||||
guard emojis.isEmpty else { return emojis.count }
|
||||
for emoji in hoarder.emojis {
|
||||
guard let sticker = emoji.msSticker else { continue }
|
||||
emojis.append(sticker)
|
||||
}
|
||||
return emojis.count
|
||||
}
|
||||
|
||||
func stickerBrowserView(_ stickerBrowserView: MSStickerBrowserView, stickerAt index: Int) -> MSSticker {
|
||||
return msStickers[index]
|
||||
return emojis[index]
|
||||
}
|
||||
}
|
||||