Compare commits

..
0 Commits
42 changed files with 609 additions and 1421 deletions

No files matched your search

@@ -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

+30 -54
View File
@@ -44,7 +44,7 @@
A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; }; A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; };
A957C17F2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; }; A957C17F2ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; };
A957C1802ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; }; A957C1802ECFAA1100EA3EE9 /* GifView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A957C17D2ECFAA1100EA3EE9 /* GifView.swift */; };
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 */; }; 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, ); }; }; 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 */; }; 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 */; }; A99589AF2F5E0D83003A4A8C /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = A99589AE2F5E0D83003A4A8C /* image.png */; };
A99589B02F5E0D83003A4A8C /* 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 */; }; 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 */; }; A9A7A43F2F6835F800BB84C6 /* Trending.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A43E2F6835F800BB84C6 /* Trending.swift */; };
A9A7A4402F6835F800BB84C6 /* 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 */; }; A9A7A4422F68360200BB84C6 /* GifObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A7A4412F68360200BB84C6 /* GifObject.swift */; };
@@ -91,9 +89,6 @@
A9BBC5182EB8FA4500FFE82F /* ViewModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */; }; A9BBC5182EB8FA4500FFE82F /* ViewModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */; };
A9BBC5192EB8FA4500FFE82F /* 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 */; }; 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 */; }; A9BE30EC2F5AFE1E00A57668 /* StickerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EB2F5AFE1E00A57668 /* StickerType.swift */; };
A9BE30EF2F5B004800A57668 /* GifHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EE2F5B004800A57668 /* GifHoarder.swift */; }; A9BE30EF2F5B004800A57668 /* GifHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EE2F5B004800A57668 /* GifHoarder.swift */; };
A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EE2F5B004800A57668 /* GifHoarder.swift */; }; A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EE2F5B004800A57668 /* GifHoarder.swift */; };
@@ -109,24 +104,21 @@
A9BE30FF2F5FA78E00A57668 /* Hoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30FD2F5FA47100A57668 /* Hoarder.swift */; }; A9BE30FF2F5FA78E00A57668 /* Hoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30FD2F5FA47100A57668 /* Hoarder.swift */; };
A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; }; A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
A9C172DD2EB8C9AC008A7885 /* 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 */; }; A9CD6C352EDDE22800B7F421 /* EmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */; };
A9CD6C362EDDE22800B7F421 /* EmojiPackDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackDetailView.swift */; }; A9CD6C362EDDE22800B7F421 /* EmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */; };
A9CD6C382EDDE37500B7F421 /* EmojiPackManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C372EDDE37500B7F421 /* EmojiPackManager.swift */; }; A9CD6C382EDDE37500B7F421 /* EmojiPackManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C372EDDE37500B7F421 /* EmojiPackManager.swift */; };
A9CD6C392EDDE37500B7F421 /* 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 */; }; A9CD6C3A2EDDE6B500B7F421 /* EmojiPack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D15B892EB1142C00404792 /* EmojiPack.swift */; };
A9CD6C3B2EDDE6B500B7F421 /* 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 */; }; A9D15B8B2EB1142C00404792 /* EmojiPack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D15B892EB1142C00404792 /* EmojiPack.swift */; };
A9D6A8212F7014AE00F198FB /* TestStructures.swift in Sources */ = {isa = PBXBuildFile; fileRef = A995D95A2F6EBBDD0043E5F5 /* TestStructures.swift */; }; A9EB72392EB93FDB00658CEB /* EmojiCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */; };
A9EB72392EB93FDB00658CEB /* EmojiTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72382EB93FDB00658CEB /* EmojiTableView.swift */; };
A9EB72472EB948C400658CEB /* StickerRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72462EB948C400658CEB /* StickerRow.swift */; }; A9EB72472EB948C400658CEB /* StickerRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72462EB948C400658CEB /* StickerRow.swift */; };
A9EB72492EB948C400658CEB /* 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 */; }; A9EB724A2EB948E000658CEB /* EmojiCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */; };
A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; }; A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
A9EB724D2EB94A6B00658CEB /* TrieTestingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB724C2EB94A6B00658CEB /* TrieTestingView.swift */; }; A9EB724D2EB94A6B00658CEB /* TrieTestingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EB724C2EB94A6B00658CEB /* TrieTestingView.swift */; };
A9EB724F2EB94A6B00658CEB /* 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 */; }; A9EB72502EB94FAD00658CEB /* EmojiPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */; };
A9EC46AD2F6D9E4600E066E6 /* Hoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30FD2F5FA47100A57668 /* Hoarder.swift */; };
A9EC46AE2F6D9E5800E066E6 /* StickerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30EB2F5AFE1E00A57668 /* StickerType.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@@ -185,7 +177,7 @@
A957C1792ECE542D00EA3EE9 /* GifManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifManager.swift; sourceTree = "<group>"; }; A957C1792ECE542D00EA3EE9 /* GifManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifManager.swift; sourceTree = "<group>"; };
A957C17D2ECFAA1100EA3EE9 /* GifView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifView.swift; sourceTree = "<group>"; }; A957C17D2ECFAA1100EA3EE9 /* GifView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifView.swift; sourceTree = "<group>"; };
A969D6932EA3E86500399C05 /* Messages.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Messages.framework; path = Library/Frameworks/Messages.framework; sourceTree = DEVELOPER_DIR; }; A969D6932EA3E86500399C05 /* Messages.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Messages.framework; path = Library/Frameworks/Messages.framework; sourceTree = DEVELOPER_DIR; };
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; }; 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>"; }; 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>"; }; A986A6C72EB659E000B6E0FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -193,7 +185,6 @@
A986A6CA2EB659E000B6E0FA /* MessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesViewController.swift; sourceTree = "<group>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; A9A7A4442F68360900BB84C6 /* Pagination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pagination.swift; sourceTree = "<group>"; };
@@ -204,8 +195,6 @@
A9B9A8232EB2CCB5004C9245 /* StickerSlackTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StickerSlackTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; A9BE30F12F5B004E00A57668 /* Gif.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gif.swift; sourceTree = "<group>"; };
@@ -213,11 +202,11 @@
A9BE30F92F5B03F400A57668 /* Sticker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sticker.swift; sourceTree = "<group>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiCollectionView.swift; sourceTree = "<group>"; };
A9EB72462EB948C400658CEB /* StickerRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerRow.swift; sourceTree = "<group>"; }; A9EB72462EB948C400658CEB /* StickerRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerRow.swift; sourceTree = "<group>"; };
A9EB724C2EB94A6B00658CEB /* TrieTestingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrieTestingView.swift; sourceTree = "<group>"; }; A9EB724C2EB94A6B00658CEB /* TrieTestingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrieTestingView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@@ -268,7 +257,6 @@
A9104C7D2EB4022500D160EA /* MSSticker.swift */, A9104C7D2EB4022500D160EA /* MSSticker.swift */,
A957C1762ECD008E00EA3EE9 /* Bundle.swift */, A957C1762ECD008E00EA3EE9 /* Bundle.swift */,
A9A7A4672F6AA17C00BB84C6 /* Int.swift */, A9A7A4672F6AA17C00BB84C6 /* Int.swift */,
A995D95A2F6EBBDD0043E5F5 /* TestStructures.swift */,
); );
path = Extensions; path = Extensions;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -295,7 +283,9 @@
A91C098C2EBBD7AB00210C34 /* Emoji */ = { A91C098C2EBBD7AB00210C34 /* Emoji */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A9CD6C342EDDE22800B7F421 /* EmojiPackDetailView.swift */, A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */,
A9EB72462EB948C400658CEB /* StickerRow.swift */,
A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */,
); );
path = Emoji; path = Emoji;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -307,15 +297,12 @@
A949B1F02EA04E8200215164 /* ContentView.swift */, A949B1F02EA04E8200215164 /* ContentView.swift */,
A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */, A9BBC5172EB8FA4500FFE82F /* ViewModifiers.swift */,
A91C098C2EBBD7AB00210C34 /* Emoji */, 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 */, A955B3EC2EC22C4A00E1732D /* DownloadedView.swift */,
A9773C2E2EA54AF000F3B753 /* StickerPreview.swift */, A955B3F02EC22E9700E1732D /* BrowseView.swift */,
A955B3F42EC22EE900E1732D /* SearchView.swift */,
A957C1732ECCE2CE00EA3EE9 /* SettingsView.swift */,
A921C2DE2ED067BB00E57B1A /* WelcomeView.swift */,
A921C2E12ED071C900E57B1A /* ListRow.swift */,
); );
path = SwiftUI; path = SwiftUI;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -323,7 +310,7 @@
A91C098E2EBBD7C700210C34 /* UIKit */ = { A91C098E2EBBD7C700210C34 /* UIKit */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A9EB72382EB93FDB00658CEB /* EmojiTableView.swift */, A9EB72382EB93FDB00658CEB /* EmojiCollectionView.swift */,
); );
path = UIKit; path = UIKit;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -354,7 +341,6 @@
A949B1F22EA04E8200215164 /* StickerSlack */ = { A949B1F22EA04E8200215164 /* StickerSlack */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A9BDEAE12F82BFF8002798DF /* Info.plist */,
A9A7A4502F68447F00BB84C6 /* Models */, A9A7A4502F68447F00BB84C6 /* Models */,
A924C3742EA9134C00F20781 /* StickerSlack.entitlements */, A924C3742EA9134C00F20781 /* StickerSlack.entitlements */,
A949B1F12EA04E8200215164 /* StickerSlackApp.swift */, A949B1F12EA04E8200215164 /* StickerSlackApp.swift */,
@@ -631,14 +617,13 @@
A957C17F2ECFAA1100EA3EE9 /* GifView.swift in Sources */, A957C17F2ECFAA1100EA3EE9 /* GifView.swift in Sources */,
A957C1742ECCE2CE00EA3EE9 /* SettingsView.swift in Sources */, A957C1742ECCE2CE00EA3EE9 /* SettingsView.swift in Sources */,
A9A7A44B2F6837A800BB84C6 /* GiphyUser.swift in Sources */, A9A7A44B2F6837A800BB84C6 /* GiphyUser.swift in Sources */,
A9EB72392EB93FDB00658CEB /* EmojiTableView.swift in Sources */, A9EB72392EB93FDB00658CEB /* EmojiCollectionView.swift in Sources */,
A955B3EE2EC22C4A00E1732D /* DownloadedView.swift in Sources */, A955B3EE2EC22C4A00E1732D /* DownloadedView.swift in Sources */,
A949B1FB2EA0518800215164 /* SlackResponse.swift in Sources */, A949B1FB2EA0518800215164 /* SlackResponse.swift in Sources */,
A957C17A2ECE542D00EA3EE9 /* GifManager.swift in Sources */, A957C17A2ECE542D00EA3EE9 /* GifManager.swift in Sources */,
A9BDEADE2F82BC93002798DF /* NoStickersView.swift in Sources */,
A955B3F52EC22EE900E1732D /* SearchView.swift in Sources */, A955B3F52EC22EE900E1732D /* SearchView.swift in Sources */,
A935437B2EB2A3C800BB80A4 /* FilterCategory.swift in Sources */, A935437B2EB2A3C800BB80A4 /* FilterCategory.swift in Sources */,
A9CD6C352EDDE22800B7F421 /* EmojiPackDetailView.swift in Sources */, A9CD6C352EDDE22800B7F421 /* EmojiPackView.swift in Sources */,
A9A7A44E2F68383900BB84C6 /* GiphyImages.swift in Sources */, A9A7A44E2F68383900BB84C6 /* GiphyImages.swift in Sources */,
A9C172DD2EB8C9AC008A7885 /* Trie.swift in Sources */, A9C172DD2EB8C9AC008A7885 /* Trie.swift in Sources */,
A955B3F22EC22E9700E1732D /* BrowseView.swift in Sources */, A955B3F22EC22E9700E1732D /* BrowseView.swift in Sources */,
@@ -653,12 +638,11 @@
A9BBC5182EB8FA4500FFE82F /* ViewModifiers.swift in Sources */, A9BBC5182EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
A9EB72492EB948C400658CEB /* StickerRow.swift in Sources */, A9EB72492EB948C400658CEB /* StickerRow.swift in Sources */,
A921C2E22ED071C900E57B1A /* ListRow.swift in Sources */, A921C2E22ED071C900E57B1A /* ListRow.swift in Sources */,
A9773C2F2EA54AF000F3B753 /* StickerPreview.swift in Sources */, A9773C2F2EA54AF000F3B753 /* EmojiPreview.swift in Sources */,
A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */, A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */,
A9BE30F22F5B004E00A57668 /* Gif.swift in Sources */, A9BE30F22F5B004E00A57668 /* Gif.swift in Sources */,
A9BE30EC2F5AFE1E00A57668 /* StickerType.swift in Sources */, A9BE30EC2F5AFE1E00A57668 /* StickerType.swift in Sources */,
A9A7A4482F68361200BB84C6 /* Meta.swift in Sources */, A9A7A4482F68361200BB84C6 /* Meta.swift in Sources */,
A995D95C2F6EBBDD0043E5F5 /* TestStructures.swift in Sources */,
A9BE30FE2F5FA47100A57668 /* Hoarder.swift in Sources */, A9BE30FE2F5FA47100A57668 /* Hoarder.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -672,7 +656,6 @@
A986A6C32EB6598100B6E0FA /* FilterCategory.swift in Sources */, A986A6C32EB6598100B6E0FA /* FilterCategory.swift in Sources */,
A9CD6C3A2EDDE6B500B7F421 /* EmojiPack.swift in Sources */, A9CD6C3A2EDDE6B500B7F421 /* EmojiPack.swift in Sources */,
A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */, A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */,
A9BDEAE02F82BCB4002798DF /* NoStickersView.swift in Sources */,
A9BE30FA2F5B03F400A57668 /* Sticker.swift in Sources */, A9BE30FA2F5B03F400A57668 /* Sticker.swift in Sources */,
A986A6CD2EB659E000B6E0FA /* MessagesViewController.swift in Sources */, A986A6CD2EB659E000B6E0FA /* MessagesViewController.swift in Sources */,
A9A7A4572F69568700BB84C6 /* GifHoarder.swift in Sources */, A9A7A4572F69568700BB84C6 /* GifHoarder.swift in Sources */,
@@ -687,7 +670,6 @@
A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */, A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */,
A9A7A45F2F69570200BB84C6 /* Gif.swift in Sources */, A9A7A45F2F69570200BB84C6 /* Gif.swift in Sources */,
A9A7A45E2F6956B700BB84C6 /* StickerType.swift in Sources */, A9A7A45E2F6956B700BB84C6 /* StickerType.swift in Sources */,
A9D6A8212F7014AE00F198FB /* TestStructures.swift in Sources */,
A9BBC5192EB8FA4500FFE82F /* ViewModifiers.swift in Sources */, A9BBC5192EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
A986A6C42EB6598500B6E0FA /* SlackResponse.swift in Sources */, A986A6C42EB6598500B6E0FA /* SlackResponse.swift in Sources */,
A986A6C22EB6597600B6E0FA /* Emoji.swift in Sources */, A986A6C22EB6597600B6E0FA /* Emoji.swift in Sources */,
@@ -707,26 +689,22 @@
A9A7A4402F6835F800BB84C6 /* Trending.swift in Sources */, A9A7A4402F6835F800BB84C6 /* Trending.swift in Sources */,
A9BE30F72F5B011A00A57668 /* StickerProtocol.swift in Sources */, A9BE30F72F5B011A00A57668 /* StickerProtocol.swift in Sources */,
A9BE30FC2F5B03F400A57668 /* Sticker.swift in Sources */, A9BE30FC2F5B03F400A57668 /* Sticker.swift in Sources */,
A9EC46AE2F6D9E5800E066E6 /* StickerType.swift in Sources */,
A9B9A82F2EB2CCED004C9245 /* EmojiHoarder.swift in Sources */, A9B9A82F2EB2CCED004C9245 /* EmojiHoarder.swift in Sources */,
A9CD6C3B2EDDE6B500B7F421 /* EmojiPack.swift in Sources */, A9CD6C3B2EDDE6B500B7F421 /* EmojiPack.swift in Sources */,
A921C2E32ED071C900E57B1A /* ListRow.swift in Sources */, A921C2E32ED071C900E57B1A /* ListRow.swift in Sources */,
A9BE30EF2F5B004800A57668 /* GifHoarder.swift in Sources */, A9BE30EF2F5B004800A57668 /* GifHoarder.swift in Sources */,
A9A7A4492F68361200BB84C6 /* Meta.swift in Sources */, A9A7A4492F68361200BB84C6 /* Meta.swift in Sources */,
A9EB724A2EB948E000658CEB /* EmojiTableView.swift in Sources */, A9EB724A2EB948E000658CEB /* EmojiCollectionView.swift in Sources */,
A9EB724D2EB94A6B00658CEB /* TrieTestingView.swift in Sources */, A9EB724D2EB94A6B00658CEB /* TrieTestingView.swift in Sources */,
A9BBC51A2EB8FA4500FFE82F /* ViewModifiers.swift in Sources */, A9BBC51A2EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
A995D95B2F6EBBDD0043E5F5 /* TestStructures.swift in Sources */,
A955B3ED2EC22C4A00E1732D /* DownloadedView.swift in Sources */, A955B3ED2EC22C4A00E1732D /* DownloadedView.swift in Sources */,
A9EC46AD2F6D9E4600E066E6 /* Hoarder.swift in Sources */,
A9A7A4682F6AA17C00BB84C6 /* Int.swift in Sources */, A9A7A4682F6AA17C00BB84C6 /* Int.swift in Sources */,
A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */, A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */,
A957C1752ECCE2CE00EA3EE9 /* SettingsView.swift in Sources */, A957C1752ECCE2CE00EA3EE9 /* SettingsView.swift in Sources */,
A9CD6C362EDDE22800B7F421 /* EmojiPackDetailView.swift in Sources */, A9CD6C362EDDE22800B7F421 /* EmojiPackView.swift in Sources */,
A9EB72472EB948C400658CEB /* StickerRow.swift in Sources */, A9EB72472EB948C400658CEB /* StickerRow.swift in Sources */,
A9CD6C392EDDE37500B7F421 /* EmojiPackManager.swift in Sources */, A9CD6C392EDDE37500B7F421 /* EmojiPackManager.swift in Sources */,
A955B3F62EC22EE900E1732D /* SearchView.swift in Sources */, A955B3F62EC22EE900E1732D /* SearchView.swift in Sources */,
A9BDEADF2F82BC93002798DF /* NoStickersView.swift in Sources */,
A9B9A8322EB2CD29004C9245 /* SlackResponse.swift in Sources */, A9B9A8322EB2CD29004C9245 /* SlackResponse.swift in Sources */,
A957C1782ECD008E00EA3EE9 /* Bundle.swift in Sources */, A957C1782ECD008E00EA3EE9 /* Bundle.swift in Sources */,
A921C2E02ED067BB00E57B1A /* WelcomeView.swift in Sources */, A921C2E02ED067BB00E57B1A /* WelcomeView.swift in Sources */,
@@ -736,7 +714,7 @@
A9A7A44C2F6837A800BB84C6 /* GiphyUser.swift in Sources */, A9A7A44C2F6837A800BB84C6 /* GiphyUser.swift in Sources */,
A9B9A8312EB2CD14004C9245 /* FilterCategory.swift in Sources */, A9B9A8312EB2CD14004C9245 /* FilterCategory.swift in Sources */,
A957C1802ECFAA1100EA3EE9 /* GifView.swift in Sources */, A957C1802ECFAA1100EA3EE9 /* GifView.swift in Sources */,
A9EB72502EB94FAD00658CEB /* StickerPreview.swift in Sources */, A9EB72502EB94FAD00658CEB /* EmojiPreview.swift in Sources */,
A9A7A4432F68360200BB84C6 /* GifObject.swift in Sources */, A9A7A4432F68360200BB84C6 /* GifObject.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@@ -901,7 +879,6 @@
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly; ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = StickerSlack/Info.plist;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
@@ -932,7 +909,7 @@
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 6.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,7"; TARGETED_DEVICE_FAMILY = "1,2,7";
XROS_DEPLOYMENT_TARGET = 1; XROS_DEPLOYMENT_TARGET = 1;
}; };
@@ -953,7 +930,6 @@
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly; ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = StickerSlack/Info.plist;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
@@ -984,7 +960,7 @@
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 6.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,7"; TARGETED_DEVICE_FAMILY = "1,2,7";
XROS_DEPLOYMENT_TARGET = 1; XROS_DEPLOYMENT_TARGET = 1;
}; };
@@ -1017,7 +993,7 @@
SWIFT_APPROACHABLE_CONCURRENCY = YES; SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 6.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
@@ -1049,7 +1025,7 @@
SWIFT_APPROACHABLE_CONCURRENCY = YES; SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 6.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
@@ -1072,7 +1048,7 @@
SWIFT_APPROACHABLE_CONCURRENCY = YES; SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 6.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StickerSlack.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/StickerSlack"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StickerSlack.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/StickerSlack";
}; };
@@ -1095,7 +1071,7 @@
SWIFT_APPROACHABLE_CONCURRENCY = YES; SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 6.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StickerSlack.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/StickerSlack"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StickerSlack.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/StickerSlack";
VALIDATE_PRODUCT = YES; 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 name: String
var description: String var description: String
var emojiNames: [String] var emojiNames: [String]
}
static var test: EmojiPack {
extension EmojiPack {
static func new() -> EmojiPack {
EmojiPack( EmojiPack(
id: UUID(), id: UUID(),
name: "New Pack", name: "test pack",
description: "Emoji Pack at \(Date().formatted())", description: "neon443's debug emoji pack",
emojiNames: [] emojiNames: [
"pf",
"heavysob",
"yay",
"skulk",
"loll",
"bleh",
"uhh",
"communist"
]
) )
} }
} }
@@ -11,46 +11,9 @@ struct EmojiPackManager: View {
@ObservedObject var hoarder: EmojiHoarder @ObservedObject var hoarder: EmojiHoarder
var body: some View { var body: some View {
NavigationStack { ForEach(hoarder.emojiPacks) { pack in
List { EmojiPackView(hoarder: hoarder, pack: pack)
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())
}
}
} }
Divider()
} }
} }
+16 -2
View File
@@ -11,11 +11,15 @@ import SwiftUI
import Messages import Messages
import UniformTypeIdentifiers import UniformTypeIdentifiers
@MainActor
struct Emoji: StickerProtocol { struct Emoji: StickerProtocol {
var id: String var id: String
var name: String 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+fileExtension
}
var remoteImageURL: URL var remoteImageURL: URL
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
@@ -40,4 +44,14 @@ struct Emoji: StickerProtocol {
self.name = name self.name = name
self.remoteImageURL = url 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")!
)
} }
+85 -63
View File
@@ -11,18 +11,19 @@ import Combine
import UniformTypeIdentifiers import UniformTypeIdentifiers
import Haptics import Haptics
class EmojiHoarder: BaseHoarder { class EmojiHoarder: Hoarder, ObservableObject {
nonisolated static let container: URL = library.appendingPathComponent("Emojis", conformingTo: .directory) static let container: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
nonisolated static let localEmojiDB: URL = EmojiHoarder.library.appendingPathComponent("_____localEmojiDB.json", conformingTo: .fileURL) nonisolated static let localEmojiDB: URL = EmojiHoarder.container.appendingPathComponent("_localEmojiDB.json", conformingTo: .fileURL)
nonisolated static let localTrieDict: URL = EmojiHoarder.library.appendingPathComponent("_____localTrieDict.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")! let endpoint: URL = URL(string: "https://cachet.dunkirk.sh/emojis")!
@Published var emojis: [Emoji] = [] @Published var emojis: [Emoji] = []
@Published var emojiPacks: [EmojiPack] = [.test] @Published var emojiPacks: [EmojiPack] = []
@Published var trie: Trie = Trie() @Published var trie: Trie = Trie()
// @Published var downloadedStickers: Set<String> = [] @Published var downloadedStickers: Set<String> = []
var downloadedStickersArr: [String] = [] @Published var downloadedEmojisArr: [String] = []
@Published var letterStats: [EmojiHoarder.LetterStat] = [] @Published var letterStats: [EmojiHoarder.LetterStat] = []
@Published var letterStatsSorting: EmojiHoarder.LetterStatSorting = .init(by: .letter, ascending: true) @Published var letterStatsSorting: EmojiHoarder.LetterStatSorting = .init(by: .letter, ascending: true)
@@ -30,29 +31,18 @@ class EmojiHoarder: BaseHoarder {
@Published var showWelcome: Bool = false @Published var showWelcome: Bool = false
init(localOnly: Bool = false, skipIndex: Bool = false) { init(localOnly: Bool = false, skipIndex: Bool = false) {
super.init()
self.showWelcome = !UserDefaults.standard.bool(forKey: "showWelcome") self.showWelcome = !UserDefaults.standard.bool(forKey: "showWelcome")
if !FileManager.default.fileExists(atPath: EmojiHoarder.container.path()) { let localDB = loadLocalDB()
try! FileManager.default.createDirectory(at: EmojiHoarder.container, withIntermediateDirectories: true) withAnimation(.snappy) { self.emojis = localDB }
}
self.emojis = loadLocalDB()
loadTrie() loadTrie()
if !skipIndex { buildTrie() }
startLoading(localOnly: localOnly, skipIndex: skipIndex) guard !localOnly else { return }
} Task {
func startLoading(localOnly: Bool, skipIndex: Bool) {
Task.detached {
if !skipIndex { await self.buildTrie() }
guard !localOnly else { return }
print("start loading remote db") print("start loading remote db")
await self.loadRemoteDB() await self.loadRemoteDB()
print("end") print("end")
if !skipIndex { if !skipIndex {
await self.buildTrie() await self.buildTrie()
} }
@@ -62,6 +52,9 @@ class EmojiHoarder: BaseHoarder {
@MainActor @MainActor
func downloadAllStickers() async { func downloadAllStickers() async {
let start: Date = .now let start: Date = .now
downloadedEmojisArr = []
let cores = ProcessInfo.processInfo.processorCount-1 let cores = ProcessInfo.processInfo.processorCount-1
var ranges: [Range<Int>] = [] var ranges: [Range<Int>] = []
for i in 0..<cores { for i in 0..<cores {
@@ -78,10 +71,11 @@ class EmojiHoarder: BaseHoarder {
for range in ranges { for range in ranges {
group.addTask { group.addTask {
for i in range { for i in range {
guard await !self.downloadedStickers.contains(await self.emojis[i].name) else { continue } await MainActor.run { self.downloadedEmojisArr.append(self.emojis[i].name) }
await self.download(emoji: self.emojis[i], skipStoreIndex: true) guard !self.downloadedStickers.contains(await self.emojis[i].name) else { continue }
let _ = await MainActor.run { self.downloadedStickers.insert(self.emojis[i].name) } Task { await self.download(emoji: self.emojis[i], skipStoreIndex: true) }
if await i == self.emojis.count { await MainActor.run { self.downloadedStickers.insert(self.emojis[i].name) }
if i == self.emojis.count {
Task { @MainActor in Task { @MainActor in
self.storeDownloadedIndexes() self.storeDownloadedIndexes()
} }
@@ -101,6 +95,7 @@ class EmojiHoarder: BaseHoarder {
delete(emoji: emojis[i], skipStoreIndex: true) delete(emoji: emojis[i], skipStoreIndex: true)
} }
downloadedStickers = [] downloadedStickers = []
downloadedEmojisArr = []
storeDownloadedIndexes() storeDownloadedIndexes()
} }
@@ -113,14 +108,24 @@ class EmojiHoarder: BaseHoarder {
trie.dict = [:] trie.dict = [:]
trie.wordlist = [] trie.wordlist = []
try? FileManager.default.removeItem(at: EmojiHoarder.localEmojiDB) try? FileManager.default.removeItem(at: EmojiHoarder.localEmojiDB)
try? FileManager.default.removeItem(at: EmojiHoarder.localTrie)
try? FileManager.default.removeItem(at: EmojiHoarder.localTrieDict) try? FileManager.default.removeItem(at: EmojiHoarder.localTrieDict)
downloadedStickers = [] downloadedStickers = []
downloadedEmojisArr = []
UserDefaults.standard.removeObject(forKey: "downloadedEmojis") UserDefaults.standard.removeObject(forKey: "downloadedEmojis")
UserDefaults.standard.removeObject(forKey: "downloadedEmojisArr")
letterStats = [] letterStats = []
} }
//cl i disabled ts cos its quicker to rebuild it then to load ts
private func saveTrie() { 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 { guard let dataDict = try? encoder.encode(trie.dict) else {
fatalError("failed to encode trie dict") fatalError("failed to encode trie dict")
} }
@@ -128,7 +133,15 @@ class EmojiHoarder: BaseHoarder {
} }
private func loadTrie() { 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 dataDict = try? Data(contentsOf: EmojiHoarder.localTrieDict) else { return }
guard let decodedDict = try? decoder.decode([String:Emoji].self, from: dataDict) else { guard let decodedDict = try? decoder.decode([String:Emoji].self, from: dataDict) else {
fatalError("failed to decode dict") fatalError("failed to decode dict")
@@ -136,34 +149,45 @@ class EmojiHoarder: BaseHoarder {
self.trie.dict = decodedDict self.trie.dict = decodedDict
} }
nonisolated func buildTrie() {
func buildTrie() async {
let start = Date().timeIntervalSince1970 let start = Date().timeIntervalSince1970
var wordlist = await trie.wordlist for emoji in emojis {
var dict = await trie.dict trie.insert(word: emoji.name)
for emoji in await emojis {
// trie.insert(word: emoji.name)
wordlist.insert(emoji.name)
dict[emoji.name] = emoji
} }
await trie.wordlist = wordlist buildTrieDict()
await trie.dict = dict saveTrie()
generateLetterStats()
await buildDownloadedStickers()
await saveTrie()
print("done building trie in", Date().timeIntervalSince1970-start) print("done building trie in", Date().timeIntervalSince1970-start)
} }
override func buildDownloadedStickers(for stickerType: String = "Emojis") async { private func buildTrieDict() {
await super.buildDownloadedStickers(for: stickerType) for emoji in emojis {
downloadedStickersArr = Array(downloadedStickers).sorted() trie.dict[emoji.name] = emoji
}
buildDownloadedEmojis()
}
private func buildDownloadedEmojis() {
downloadedStickers = []
downloadedEmojisArr = []
downloadedEmojisArr = (try? decoder.decode([String].self, from: UserDefaults.standard.data(forKey: "downloadedEmojisArr") ?? Data())) ?? []
downloadedStickers = (try? decoder.decode(Set<String>.self, from: UserDefaults.standard.data(forKey: "downloadedEmojis") ?? Data())) ?? []
if downloadedStickers.isEmpty || downloadedEmojisArr.isEmpty {
for emoji in emojis {
guard emoji.isLocal else { continue }
downloadedStickers.insert(emoji.name)
downloadedEmojisArr.append(emoji.name)
}
}
} }
func storeDownloadedIndexes() { func storeDownloadedIndexes() {
UserDefaults.standard.set(try! encoder.encode(downloadedStickers), forKey: "downloadedEmojis") UserDefaults.standard.set(try! encoder.encode(downloadedStickers), forKey: "downloadedEmojis")
UserDefaults.standard.set(try! encoder.encode(downloadedEmojisArr), forKey: "downloadedEmojisArr")
} }
// nonisolated nonisolated
private func loadLocalDB() -> [Emoji] { private func loadLocalDB() -> [Emoji] {
if let localEmojiDB = try? Data(contentsOf: EmojiHoarder.localEmojiDB) { if let localEmojiDB = try? Data(contentsOf: EmojiHoarder.localEmojiDB) {
let decoded = try! decoder.decode([Emoji].self, from: localEmojiDB) let decoded = try! decoder.decode([Emoji].self, from: localEmojiDB)
@@ -172,13 +196,10 @@ class EmojiHoarder: BaseHoarder {
return [] return []
} }
nonisolated
private func loadRemoteDB() async { private func loadRemoteDB() async {
async let fetched = self.fetchRemoteDB() async let fetched = self.fetchRemoteDB()
if let fetched = await fetched { 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]? { private func fetchRemoteDB() async -> [Emoji]? {
do { do {
async let (data, _) = try URLSession.shared.data(from: endpoint) 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) try await storeDB(data: await data)
return await SlackResponse.toEmojis(from: decoded) return await SlackResponse.toEmojis(from: decoded)
} catch { } catch {
@@ -200,41 +222,41 @@ class EmojiHoarder: BaseHoarder {
let local = loadLocalDB() let local = loadLocalDB()
await MainActor.run { await MainActor.run {
emojis = local emojis = local
buildTrie()
} }
await buildTrie()
return return
} }
await MainActor.run { await MainActor.run {
withAnimation(.snappy) { self.emojis = fetched } withAnimation(.snappy) { self.emojis = fetched }
buildTrie()
} }
await buildTrie()
} }
override nonisolated func download(emoji: any StickerProtocol, skipStoreIndex: Bool = false) async { nonisolated func download(emoji: StickerProtocol, skipStoreIndex: Bool = false) async {
await super.download(emoji: emoji, skipStoreIndex: skipStoreIndex) try? await emoji.downloadImage()
// try? await emoji.downloadImage()
await MainActor.run { await MainActor.run {
if !skipStoreIndex { if !skipStoreIndex {
let _ = withAnimation(.snappy) { withAnimation(.snappy) {
self.downloadedStickers.insert(emoji.name) self.downloadedStickers.insert(emoji.name)
self.downloadedStickersArr.append(emoji.name) self.downloadedEmojisArr.append(emoji.name)
} }
self.storeDownloadedIndexes() self.storeDownloadedIndexes()
} }
if !skipStoreIndex { Haptic.success.trigger() }
} }
} }
override func delete(emoji: any StickerProtocol, skipStoreIndex: Bool = false) { @MainActor
super.delete(emoji: emoji, skipStoreIndex: skipStoreIndex) func delete(emoji: StickerProtocol, skipStoreIndex: Bool = false) {
// emoji.deleteImage() emoji.deleteImage()
if !skipStoreIndex { if !skipStoreIndex {
let _ = withAnimation(.snappy) { withAnimation(.snappy) {
downloadedStickers.remove(emoji.name) downloadedStickers.remove(emoji.name)
downloadedStickersArr.removeAll(where: { $0 == emoji.name }) downloadedEmojisArr.removeAll(where: { $0 == emoji.name })
} }
storeDownloadedIndexes() storeDownloadedIndexes()
} }
if !skipStoreIndex { Haptic.heavy.trigger() }
} }
func setShowWelcome(to newValue: Bool) { func setShowWelcome(to newValue: Bool) {
+3 -2
View File
@@ -12,8 +12,9 @@ class GifManager {
//from clock-run, 12 frames one second //from clock-run, 12 frames one second
static let defaultDuration: Double = 0.083333333333333329 static let defaultDuration: Double = 0.083333333333333329
static func gifFrom(url: URL) async throws -> [(frame: CGImage, showFor: Double)] { static func gifFrom(url: URL) async -> [(frame: CGImage, showFor: Double)] {
let (data, _) = try await URLSession.shared.data(from: url) guard let (data, _) = try? await URLSession.shared.data(from: url) else { return [] }
return gifFrom(data: data) return gifFrom(data: data)
} }
+22 -56
View File
@@ -16,81 +16,47 @@ struct GifView: View {
@State var currentI: Int = 0 @State var currentI: Int = 0
@State var timer: Timer? @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 { var body: some View {
// /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Hello, world!@*/Text("Hello, world!")/*@END_MENU_TOKEN@*/ // /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Hello, world!@*/Text("Hello, world!")/*@END_MENU_TOKEN@*/
TimelineView(.animation) { tl in TimelineView(.animation) { tl in
VStack { VStack {
if gif.isEmpty && error == nil { if currentI < gif.count {
ProgressView() let image = Image(uiImage: .init(cgImage: gif[currentI].frame))
.controlSize(.large) image
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else if failed {
Image(systemName: "xmark")
.resizable().scaledToFit() .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 { .onDisappear {
timer?.invalidate() timer?.invalidate()
timer = nil timer = nil
} }
.task { .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 { #Preview {
GifView( 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,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"
]
)
}
}
+34 -9
View File
@@ -9,28 +9,53 @@ import Foundation
import SwiftUI import SwiftUI
import UniformTypeIdentifiers import UniformTypeIdentifiers
@MainActor
struct Gif: StickerProtocol { struct Gif: StickerProtocol {
var id: String var id: String
var name: String 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+fileExtension
}
var remoteImageURL: URL var remoteImageURL: URL
var giphyImages: GiphyImages? // enum CodingKeys: String, CodingKey {
//
// enum CodingKeys: String, CodingKey { // }
//
// }
init( init(
name: String, name: String,
url: URL, url: URL,
giphyImages: GiphyImages?,
id: String = UUID().uuidString id: String = UUID().uuidString
) { ) {
self.id = id self.id = id
self.name = name self.name = name
self.giphyImages = giphyImages
self.remoteImageURL = url 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")!
)
} }
+15 -35
View File
@@ -10,8 +10,8 @@ import SwiftUI
import UniformTypeIdentifiers import UniformTypeIdentifiers
import Combine import Combine
class GifHoarder: BaseHoarder { class GifHoarder: Hoarder, ObservableObject {
nonisolated static let container: URL = library.appendingPathComponent("Gifs", conformingTo: .directory) 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 = "a2mFsDTpX5blodY8ltkG6Q1xy5NgFSbc"
var endpoint: URL = URL(string: "https://api.giphy.com/v1/gifs/trending")! var endpoint: URL = URL(string: "https://api.giphy.com/v1/gifs/trending")!
@@ -19,28 +19,27 @@ class GifHoarder: BaseHoarder {
@Published var searchTerm: String = "" @Published var searchTerm: String = ""
@Published var trendingGifs: [Gif] = [] @Published var trendingGifs: [Gif] = []
// @Published override var downloadedStickers: Set<String> = [] @Published var downloadedStickers: Set<String> = []
func download(emoji: any StickerProtocol, skipStoreIndex: Bool = false) {
// <#code#>
}
func delete(emoji: any StickerProtocol, skipStoreIndex: Bool = false) {
// <#code#>
}
init(localOnly: Bool = false) { 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) var components = URLComponents(url: endpoint, resolvingAgainstBaseURL: false)
components?.queryItems = [ components?.queryItems = [
URLQueryItem(name: "api_key", value: GifHoarder.apiKey), 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 { Task {
do { do {
let (data, _) = try await URLSession.shared.data(from: finalURL) async let (data, _) = try URLSession.shared.data(from: components!.url!)
let object: Trending = try JSONDecoder().decode(Trending.self, from: data) let object: Trending = try JSONDecoder().decode(Trending.self, from: await data)
guard object.meta.status == 200 else { guard object.meta.status == 200 else {
fatalError("non ok status code") fatalError("non ok status code")
} }
@@ -48,25 +47,6 @@ class GifHoarder: BaseHoarder {
} catch { } catch {
print(error) 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)
}
} }
+5 -47
View File
@@ -9,10 +9,10 @@ import Foundation
import SwiftUI import SwiftUI
import Combine import Combine
import UniformTypeIdentifiers import UniformTypeIdentifiers
import Haptics
protocol Hoarder: ObservableObject { protocol Hoarder: ObservableObject {
static var library: URL { get } static var container: URL { get }
var endpoint: URL { get }
var downloadedStickers: Set<String> { get set } var downloadedStickers: Set<String> { get set }
var encoder: JSONEncoder { get } var encoder: JSONEncoder { get }
var decoder: JSONDecoder { get } var decoder: JSONDecoder { get }
@@ -21,49 +21,7 @@ protocol Hoarder: ObservableObject {
func delete(emoji: any StickerProtocol, skipStoreIndex: Bool) func delete(emoji: any StickerProtocol, skipStoreIndex: Bool)
} }
class BaseHoarder: Hoarder { extension Hoarder {
nonisolated static let library: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory) var encoder: JSONEncoder { JSONEncoder() }
var decoder: JSONDecoder { JSONDecoder() }
@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() { }
} }
-19
View File
@@ -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,7 +7,6 @@
import Foundation import Foundation
@MainActor
struct SlackResponse: Identifiable, Codable { struct SlackResponse: Identifiable, Codable {
var type: String var type: String
var id: String var id: String
+1 -7
View File
@@ -7,7 +7,6 @@
import Foundation import Foundation
@MainActor
struct GifObject: Codable, Identifiable { struct GifObject: Codable, Identifiable {
var type: String var type: String
var id: String var id: String
@@ -32,11 +31,6 @@ struct GifObject: Codable, Identifiable {
var is_low_contrast: Bool var is_low_contrast: Bool
var toGif: Gif { var toGif: Gif {
return Gif( return Gif(name: self.title, url: URL(string: self.images.fixed_width.url)!, id: self.id)
name: self.title,
url: URL(string: self.images.fixed_width.url)!,
giphyImages: images,
id: self.id
)
} }
} }
+20 -20
View File
@@ -7,54 +7,54 @@
import Foundation import Foundation
struct GiphyImages: Codable, Equatable, Hashable { struct GiphyImages: Codable {
//fixed height of 200px //fixed height of 200px
var fixed_height: motion var fixed_height: motion
//fixed height of 200px still //fixed height of 200px still
var fixed_height_still: still? var fixed_height_still: still
//fixed height 200px with 6 frames //fixed height 200px with 6 frames
var fixed_height_downsampled: downsampled var fixed_height_downsampled: downsampled
//fixed height of 100px //fixed height of 100px
var fixed_height_small: motion var fixed_height_small: motion
//fixed height of 100px still //fixed height of 100px still
var fixed_height_small_still: still? var fixed_height_small_still: still
//fixed width of 200px //fixed width of 200px
var fixed_width: motion var fixed_width: motion
//fixed width of 200px //fixed width of 200px
var fixed_width_still: still? var fixed_width_still: still
//fixed width 200px with 6 frames //fixed width 200px with 6 frames
var fixed_width_downsampled: downsampled var fixed_width_downsampled: downsampled
//fixed width of 100px //fixed width of 100px
var fixed_width_small: motion var fixed_width_small: motion
//fixed width of 100px still //fixed width of 100px still
var fixed_width_small_still: still? var fixed_width_small_still: still
//under 2mb //under 2mb
var downsized: downsized? var downsized: downsized
//downsized still //downsized still
var downsized_still: still? var downsized_still: still
//under 8mb //under 8mb
var downsized_large: downsized? var downsized_large: downsized
//under 5mb //under 5mb
var downsized_medium: downsized? var downsized_medium: downsized
//under 200kb //under 200kb
var downsized_small: video? var downsized_small: video
var original: motion var original: motion
var original_still: still? var original_still: still
//15s looping version //15s looping version
// var looping: looping? // var looping: looping
//mp4 format 50kb, first 1-2s of the gif //mp4 format 50kb, first 1-2s of the gif
var preview: video? var preview: video
//50kb first 1-2s of the gif //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 url: String
var width: String var width: String
var height: String var height: String
@@ -64,12 +64,12 @@ struct GiphyImages: Codable, Equatable, Hashable {
var webp: String var webp: String
var webp_size: String var webp_size: String
} }
struct still: Codable, Equatable, Hashable { struct still: Codable {
var url: String var url: String
var width: String var width: String
var height: String var height: String
} }
struct downsampled: Codable, Equatable, Hashable { struct downsampled: Codable {
var url: String var url: String
var width: String var width: String
var height: String var height: String
@@ -77,16 +77,16 @@ struct GiphyImages: Codable, Equatable, Hashable {
var webp: String var webp: String
var webp_size: String var webp_size: String
} }
struct downsized: Codable, Equatable, Hashable { struct downsized: Codable {
var url: String var url: String
var width: String var width: String
var height: String var height: String
var size: String var size: String
} }
struct looping: Codable, Equatable, Hashable { struct looping: Codable {
var mp4: String var mp4: String
} }
struct video: Codable, Equatable, Hashable { struct video: Codable {
var mp4: String var mp4: String
var mp4_size: String var mp4_size: String
var width: String var width: String
+25 -35
View File
@@ -8,23 +8,34 @@
import Foundation import Foundation
import Messages import Messages
nonisolated
extension StickerProtocol { extension StickerProtocol {
nonisolated var localImageURLString: String { var localImageURL: URL {
let urlString = remoteImageURL.absoluteString return URL(string: localImageURLString)!
let split = urlString.split(separator: ".")
let fileExtension = ".\(split.last ?? "png")"
return GifHoarder.container.path()+name+"."+id+fileExtension
} }
nonisolated var localImageURL: URL { var isLocal: Bool {
return URL(filePath: localImageURLString) 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 nonisolated
func downloadImage() async throws { func downloadImage() async throws {
if let data = try? Data(contentsOf: localImageURL), if let data = try? await Data(contentsOf: localImageURL),
let _ = UIImage(data: data) { let _ = UIImage(data: data) {
return return
} }
@@ -33,23 +44,19 @@ extension StickerProtocol {
if let uiImage = UIImage(data: data), if let uiImage = UIImage(data: data),
let cgImage = uiImage.cgImage, let cgImage = uiImage.cgImage,
!self.localImageURLString.contains(".gif"), await !self.localImageURLString.contains(".gif"),
cgImage.width < 300 || cgImage.height < 300 { 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 return
} }
nonisolated
func deleteImage() { func deleteImage() {
try? FileManager.default.removeItem(at: localImageURL) try? FileManager.default.removeItem(at: localImageURL)
return return
} }
}
@MainActor
extension StickerProtocol {
func resize(image: UIImage, to targetSize: CGSize) -> UIImage { func resize(image: UIImage, to targetSize: CGSize) -> UIImage {
let oldSize = image.size let oldSize = image.size
let ratio: (x: CGFloat, y: CGFloat) let ratio: (x: CGFloat, y: CGFloat)
@@ -80,21 +87,4 @@ extension StickerProtocol {
image.draw(in: rect) image.draw(in: rect)
return UIGraphicsGetImageFromCurrentImageContext() ?? UIImage() 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
}
}
} }
+12 -13
View File
@@ -8,22 +8,21 @@
import Foundation import Foundation
import Messages import Messages
nonisolated
protocol StickerProtocol: Codable, Identifiable, Hashable { protocol StickerProtocol: Codable, Identifiable, Hashable {
nonisolated var id: String { get set } var id: String { get set }
nonisolated var name: String { 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 } var isLocal: Bool { get }
nonisolated var localImageURLString: String { get }
nonisolated var remoteImageURL: URL { get set }
nonisolated var msSticker: MSSticker? { get } var msSticker: MSSticker? { get }
nonisolated var image: UIImage? { get } var image: UIImage? { get }
nonisolated func downloadImage() async throws func downloadImage() async throws
nonisolated func deleteImage() func deleteImage()
nonisolated func resize(image: UIImage, to targetSize: CGSize) -> UIImage func resize(image: UIImage, to targetSize: CGSize) -> UIImage
nonisolated static var test: Self { get } static var test: Self { get }
} }
+14 -22
View File
@@ -12,35 +12,27 @@ struct BrowseView: View {
@ObservedObject var emojiHoarder: EmojiHoarder @ObservedObject var emojiHoarder: EmojiHoarder
@ObservedObject var gifHoarder: GifHoarder @ObservedObject var gifHoarder: GifHoarder
var body: some View { var body: some View {
VStack { List {
Picker("", selection: $browseWhat) { Picker("", selection: $browseWhat) {
ForEach(StickerType.allCases) { type in ForEach(StickerType.allCases, id: \.self) { type in
Text(type.description).tag(type) Text(type.description)
} }
} }
.pickerStyle(.segmented) .pickerStyle(.segmented)
.padding(.horizontal) switch browseWhat {
Group { case .slackEmoji:
switch browseWhat { ForEach(emojiHoarder.emojis, id: \.self) { emoji in
case .slackEmoji: StickerRow(hoarder: emojiHoarder, emoji: emoji)
EmojiTableView( .listRowSeparator(.hidden)
hoarder: emojiHoarder, }
items: emojiHoarder.emojis.map { $0.name } case .giphyGifs:
) ForEach(gifHoarder.trendingGifs) { gif in
.ignoresSafeArea(.container, edges: .bottom) StickerRow(hoarder: emojiHoarder, emoji: gif)
.id(emojiHoarder.emojis)
case .giphyGifs:
ScrollView {
ForEach(gifHoarder.trendingGifs) { gif in
StickerRow(hoarder: gifHoarder, sticker: gif)
.listRowSeparator(.hidden)
}
}
} }
} }
} }
} }
} }
#Preview { #Preview {
-8
View File
@@ -20,10 +20,6 @@ struct ContentView: View {
BrowseView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder) BrowseView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder)
} }
Tab("Packs", systemImage: "square.stack.3d.up.fill") {
EmojiPackManager(hoarder: emojiHoarder)
}
Tab("Downloaded", systemImage: "arrow.down.circle.fill") { Tab("Downloaded", systemImage: "arrow.down.circle.fill") {
DownloadedView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder) DownloadedView(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder)
} }
@@ -42,10 +38,6 @@ struct ContentView: View {
.tabItem { .tabItem {
Label("Browse", systemImage: "square.grid.2x2.fill") 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(emojiHoarder: emojiHoarder, gifHoarder: gifhoarder)
.tabItem { .tabItem {
Label("Downloaded", systemImage: "arrow.down.circle.fill") Label("Downloaded", systemImage: "arrow.down.circle.fill")
+2 -14
View File
@@ -13,7 +13,6 @@ struct DownloadedView: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme
var isDark: Bool { colorScheme == .dark } var isDark: Bool { colorScheme == .dark }
@State var browseWhat: StickerType = .slackEmoji
var minColWidth: CGFloat { 75 } var minColWidth: CGFloat { 75 }
var spacing: CGFloat { 5 } var spacing: CGFloat { 5 }
@@ -26,28 +25,17 @@ struct DownloadedView: View {
} }
var body: some 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 GeometryReader { geo in
ScrollView { ScrollView {
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing))) let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
let layout = Array(repeating: col, count: columns) let layout = Array(repeating: col, count: columns)
LazyVGrid(columns: layout, spacing: spacing) { LazyVGrid(columns: layout, spacing: spacing) {
ForEach(emojiHoarder.downloadedStickersArr, id: \.self) { name in ForEach(emojiHoarder.downloadedEmojisArr, id: \.self) { name in
if let emoji = emojiHoarder.trie.dict[name] { if let emoji = emojiHoarder.trie.dict[name] {
ZStack { ZStack {
Rectangle() Rectangle()
.foregroundStyle(isDark ? .black : .white) .foregroundStyle(isDark ? .black : .white)
StickerPreview(sticker: emoji) StickerPreview(emoji: emoji)
RoundedRectangle(cornerRadius: 15) RoundedRectangle(cornerRadius: 15)
.stroke(.gray, lineWidth: 1) .stroke(.gray, lineWidth: 1)
} }
@@ -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
StickerPreview(emoji: hoarder.trie.dict[name] ?? .test)
}
}
}
#Preview {
EmojiPackView(
hoarder: EmojiHoarder(localOnly: true, skipIndex: true),
pack: .test
)
}
@@ -0,0 +1,39 @@
//
// EmojiPreview.swift
// StickerSlack
//
// Created by neon443 on 19/10/2025.
//
import SwiftUI
import Haptics
struct StickerPreview: View {
@State var emoji: any StickerProtocol
@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 {
StickerPreview(
emoji: Emoji.test
)
}
@@ -10,40 +10,40 @@ import Haptics
struct StickerRow<T: Hoarder>: View { struct StickerRow<T: Hoarder>: View {
@ObservedObject var hoarder: T @ObservedObject var hoarder: T
@State var sticker: any StickerProtocol @State var emoji: any StickerProtocol
@State var showTooltip: Bool = false @State var showTooltip: Bool = false
var isDownloaded: Bool { var isLocal: Bool {
return hoarder.downloadedStickers.contains(sticker.name) return hoarder.downloadedStickers.contains(emoji.name)
} }
var body: some View { var body: some View {
HStack { HStack {
StickerPreview(sticker: sticker) StickerPreview(emoji: emoji)
.frame(width: 100, height: 100) .frame(width: 100, height: 100)
.transition(.scale) .transition(.scale)
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
Text(sticker.name) Text(emoji.name)
.font(.caption) .font(.caption)
.bold(isDownloaded) .bold(isLocal)
.foregroundColor(isDownloaded ? .green : .primary) .foregroundColor(isLocal ? .green : .primary)
.lineLimit(nil) .lineLimit(nil)
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
VStack(alignment: .leading, spacing: 5) { HStack(spacing: 5) {
Button { Button {
showTooltip.toggle() showTooltip.toggle()
} label: { } label: {
Image(sticker.typeGlyph) Image("slack.logo")
.resizable().scaledToFit() .resizable().scaledToFit()
.frame(maxHeight: 20) .frame(width: 20, height: 20)
.foregroundStyle(.gray) .foregroundStyle(.gray)
} }
.buttonStyle(.borderless) .buttonStyle(.borderless)
.alert("From Slack", isPresented: $showTooltip) { .alert("From Slack", isPresented: $showTooltip) {
Button("Done") {} Button("Done") {}
} }
if isDownloaded { if isLocal {
Image(systemName: "arrow.down.circle.fill") Image(systemName: "arrow.down.circle.fill")
.resizable().scaledToFit() .resizable().scaledToFit()
.frame(width: 20, height: 20) .frame(width: 20, height: 20)
@@ -56,21 +56,22 @@ struct StickerRow<T: Hoarder>: View {
.padding(5) .padding(5)
.background( .background(
RoundedRectangle(cornerRadius: 15) RoundedRectangle(cornerRadius: 15)
.foregroundStyle(.gray.opacity(0.2)) .foregroundStyle(.gray.opacity(0.1))
.shadow(radius: 2)
) )
Spacer() Spacer()
if isDownloaded { if isLocal {
Button("", systemImage: "trash") { Button("", systemImage: "trash") {
hoarder.delete(emoji: sticker, skipStoreIndex: false) hoarder.delete(emoji: emoji, skipStoreIndex: false)
} }
.buttonStyle(.plain) .buttonStyle(.plain)
.transition(.scale) .transition(.scale)
} else { } else {
Button("", systemImage: "arrow.down.circle") { Button("", systemImage: "arrow.down.circle") {
Task.detached { Task.detached {
await hoarder.download(emoji: sticker, skipStoreIndex: false) await hoarder.download(emoji: emoji, skipStoreIndex: false)
} }
} }
.buttonStyle(.plain) .buttonStyle(.plain)
@@ -86,17 +87,21 @@ struct StickerRow<T: Hoarder>: View {
#Preview { #Preview {
@Previewable var hoarder = EmojiHoarder(localOnly: true) @Previewable var hoarder = EmojiHoarder(localOnly: true)
List { List {
StickerRow(hoarder: hoarder, sticker: Emoji.test) StickerRow(hoarder: hoarder, emoji: Emoji.test)
StickerRow(hoarder: hoarder, sticker: Emoji.testLongName) StickerRow(hoarder: hoarder, emoji: Emoji.testLongName)
StickerRow(hoarder: hoarder, sticker: Gif.test) StickerRow(hoarder: hoarder, emoji: Gif.test)
StickerRow(hoarder: hoarder, sticker: Emoji(name: "a", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "a", url: Emoji.test.remoteImageURL))
StickerRow(hoarder: hoarder, sticker: Emoji(name: "ab", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "ab", url: Emoji.test.remoteImageURL))
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abc", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "abc", url: Emoji.test.remoteImageURL))
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcd", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "abcd", url: Emoji.test.remoteImageURL))
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcde", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "abcde", url: Emoji.test.remoteImageURL))
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcdef", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "abcdef", url: Emoji.test.remoteImageURL))
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcdefg", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "abcdefg", url: Emoji.test.remoteImageURL))
StickerRow(hoarder: hoarder, sticker: Emoji(name: "abcdefgh", url: Emoji.test.remoteImageURL)) StickerRow(hoarder: hoarder, emoji: Emoji(name: "abcdefgh", url: Emoji.test.remoteImageURL))
ForEach(hoarder.downloadedEmojisArr, id: \.self) { name in
if let emoji = hoarder.trie.dict[name] {
StickerRow(hoarder: hoarder, emoji: emoji)
}
}
} }
.listStyle(.plain)
} }
-28
View File
@@ -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()
}
+11 -64
View File
@@ -12,81 +12,33 @@ struct SearchView: View {
@State private var currentSearch: Task<Void, Never>? @State private var currentSearch: Task<Void, Never>?
@State var searchTerm: String = "" @State var searchTerm: String = ""
@State var previousSearches: [String] = []
@State var searchResult: [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 { var body: some View {
NavigationStack { NavigationStack {
if fromPackEditor { List() {
GeometryReader { geo in Text("\(searchResult.count) Result\(searchResult.count.plural)")
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing))) ForEach(searchResult, id: \.self) { name in
let layout = Array(repeating: col, count: columns) StickerRow(hoarder: hoarder, emoji: hoarder.trie.dict[name]!)
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()
}
}
} 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) .searchable(text: $searchTerm)
.onChange(of: searchTerm) { new in .onChange(of: searchTerm) { _ in
if currentSearch != nil { currentSearch?.cancel() } if searchTerm.isEmpty { searchResult = [] }
}
.onSubmit(of: .search) {
guard !searchTerm.isEmpty else { guard !searchTerm.isEmpty else {
currentSearch?.cancel() currentSearch?.cancel()
searchResult = [] searchResult = []
previousSearches = []
return return
} }
if currentSearch != nil { currentSearch?.cancel() }
currentSearch = Task.detached { currentSearch = Task.detached {
let result = await hoarder.trie.search( let result = await hoarder.trie.search(for: searchTerm)
for: searchTerm,
previousQuery: previousSearches.last,
previousResult: Set(searchResult)
)
await MainActor.run { await MainActor.run {
withAnimation(.snappy) { withAnimation(.snappy) {
searchResult = result searchResult = result
previousSearches.append(searchTerm)
} }
} }
} }
@@ -95,10 +47,5 @@ struct SearchView: View {
} }
#Preview { #Preview {
SearchView( SearchView(hoarder: EmojiHoarder(localOnly: true))
hoarder: EmojiHoarder(localOnly: true),
fromPackEditor: true
) {
print($0)
}
} }
+35 -44
View File
@@ -6,7 +6,6 @@
// //
import SwiftUI import SwiftUI
import Haptics
struct SettingsView: View { struct SettingsView: View {
@ObservedObject var hoarder: EmojiHoarder @ObservedObject var hoarder: EmojiHoarder
@@ -51,47 +50,41 @@ struct SettingsView: View {
if hoarder.downloadedStickers.count == hoarder.emojis.count { if hoarder.downloadedStickers.count == hoarder.emojis.count {
Text("🎉") Text("🎉")
.font(.largeTitle) .font(.largeTitle)
.onTapGesture {
Haptic.rigid.trigger()
}
} }
// NavigationLink { NavigationLink {
// List { List {
// Picker(selection: $hoarder.letterStatsSorting.by) { Picker(selection: $hoarder.letterStatsSorting.by) {
// ForEach(EmojiHoarder.SortLetterStatsBy.allCases, id: \.self) { sortType in ForEach(EmojiHoarder.SortLetterStatsBy.allCases, id: \.self) { sortType in
// Text(sortType.rawValue).tag(sortType) Text(sortType.rawValue).tag(sortType)
// } }
// } label: { } label: {
// Label("Sort by", systemImage: "arrow.up.arrow.down") Label("Sort by", systemImage: "arrow.up.arrow.down")
// } }
// .onChange(of: hoarder.letterStatsSorting.by) { _ in .onChange(of: hoarder.letterStatsSorting.by) { _ in
// hoarder.sortLetterStats(by: hoarder.letterStatsSorting) hoarder.sortLetterStats(by: hoarder.letterStatsSorting)
// } }
//
// Picker(selection: $hoarder.letterStatsSorting.ascending) { Picker(selection: $hoarder.letterStatsSorting.ascending) {
// Text("Ascending").tag(true) Text("Ascending").tag(true)
// Text("Descending").tag(false) Text("Descending").tag(false)
// } label: { } label: {
// Label("Order", systemImage: "greaterthan") Label("Order", systemImage: "greaterthan")
// } }
// .onChange(of: hoarder.letterStatsSorting.ascending) { _ in .onChange(of: hoarder.letterStatsSorting.ascending) { _ in
// hoarder.sortLetterStats(by: hoarder.letterStatsSorting) hoarder.sortLetterStats(by: hoarder.letterStatsSorting)
// } }
//
// ForEach(hoarder.letterStats, id: \.self) { stat in ForEach(hoarder.letterStats, id: \.self) { stat in
// HStack { HStack {
// Text("\(stat.char)") Text("\(stat.char)")
// Spacer() Spacer()
// Text("\(stat.count)") Text("\(stat.count)")
// } }
// } }
// } }
// .onAppear { } label: {
// hoarder.generateLetterStats() Label("Letter Stats", systemImage: "textformat")
// } }
// } label: {
// Label("Letter Stats", systemImage: "textformat")
// }
} }
Button("Show Welcome", systemImage: "arrow.trianglehead.clockwise") { Button("Show Welcome", systemImage: "arrow.trianglehead.clockwise") {
@@ -126,9 +119,7 @@ struct SettingsView: View {
Button("Reindex", systemImage: "list.bullet.clipboard", role: .destructive) { Button("Reindex", systemImage: "list.bullet.clipboard", role: .destructive) {
hoarder.resetAllIndexes() hoarder.resetAllIndexes()
Task { hoarder.buildTrie()
await hoarder.buildTrie()
}
} }
.foregroundStyle(.red) .foregroundStyle(.red)
} }
-74
View File
@@ -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
)
}
}
-20
View File
@@ -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
}
}
}
+25 -44
View File
@@ -9,26 +9,14 @@ import SwiftUI
struct WelcomeView: View { struct WelcomeView: View {
@Environment(\.dismiss) var dismiss @Environment(\.dismiss) var dismiss
@Environment(\.colorScheme) var colourScheme
var isDark: Bool {
return colourScheme == .dark
}
var body: some View { var body: some View {
VStack(spacing: 0) { VStack {
HStack { Text("StickerSlack")
Image("icon\(isDark ? "-dark" : "")") .bold()
.resizable().scaledToFit() .font(.largeTitle)
.frame(maxWidth: 75) .monospaced()
Spacer() .padding()
Text("StickerSlack")
.bold()
.font(.largeTitle)
.monospaced()
Spacer()
}
.padding(.vertical, 20)
.padding(.leading, 20)
List { List {
Section("How to use") { Section("How to use") {
ListRow(number: 1, text: "Browse or search for an emoji") ListRow(number: 1, text: "Browse or search for an emoji")
@@ -41,38 +29,31 @@ struct WelcomeView: View {
} }
.scrollContentBackground(.hidden) .scrollContentBackground(.hidden)
Spacer() Spacer()
Group { if #available(iOS 19, *) {
if #available(iOS 19, *) { Button() {
Button() { dismiss()
dismiss() } label: {
} label: { Text("Continue")
ContinueButtonView() .font(.title)
} .bold()
.buttonStyle(.glassProminent)
} else {
Button() {
dismiss()
} label: {
ContinueButtonView()
}
.buttonStyle(.borderedProminent)
} }
.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 { #Preview {
Color.gray.opacity(0.5) Color.gray.opacity(0.5)
.ignoresSafeArea(.all) .ignoresSafeArea(.all)
+5 -13
View File
@@ -9,23 +9,20 @@ import Foundation
import SwiftUI import SwiftUI
import Combine import Combine
nonisolated
class TrieNode: Codable { class TrieNode: Codable {
var children: [String: TrieNode] = [:] var children: [String: TrieNode] = [:]
var isEndOfWord: Bool = false var isEndOfWord: Bool = false
} }
//nonisolated
class Trie: ObservableObject { class Trie: ObservableObject {
var root: TrieNode = TrieNode() var root: TrieNode = TrieNode()
var dict: [String:Emoji] = [:] var dict: [String:Emoji] = [:]
var wordlist: Set<String> = [] var wordlist: [String] = []
// var previousSearchTerm
func insert(word: String) { func insert(word: String) {
let word = word.lowercased() let word = word.lowercased()
wordlist.insert(word) wordlist.append(word)
var currentNode = root var currentNode = root
let indices = word.indices let indices = word.indices
let last = indices.last let last = indices.last
@@ -44,17 +41,12 @@ class Trie: ObservableObject {
} }
} }
func search(for query: String, previousQuery: String?, previousResult: Set<String>?) -> [String] { func search(for query: String) -> [String] {
var result: Set<String> = wordlist var result: Set<String> = Set(wordlist)
if let previousQuery,
let previousResult,
query.hasPrefix(previousQuery) {
result = previousResult
}
for word in query.split(separator: " ") { for word in query.split(separator: " ") {
result = result.filter { $0.localizedCaseInsensitiveContains(word) } result = result.filter { $0.localizedCaseInsensitiveContains(word) }
} }
return Array(result).sorted() return Array(result)
} }
func search(exactly query: String) -> Bool { func search(exactly query: String) -> Bool {
+4 -6
View File
@@ -37,7 +37,7 @@ struct TrieTestingView: View {
case .contains: case .contains:
if searchTask != nil { searchTask?.cancel() } if searchTask != nil { searchTask?.cancel() }
searchTask = Task.detached { 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 { await MainActor.run {
withAnimation(.snappy) { searchResults = result } withAnimation(.snappy) { searchResults = result }
print("testing: contains search complete") print("testing: contains search complete")
@@ -62,9 +62,7 @@ struct TrieTestingView: View {
} }
Spacer() Spacer()
Button("add emojis!") { Button("add emojis!") {
Task { hoarder.buildTrie()
await hoarder.buildTrie()
}
} }
.buttonStyle(.borderedProminent) .buttonStyle(.borderedProminent)
} }
@@ -116,11 +114,11 @@ struct TrieTestingView: View {
} }
if uikit { if uikit {
EmojiTableView(hoarder: hoarder, items: searchResults) EmojiCollectionView(hoarder: hoarder, items: searchResults)
.animation(.snappy, value: searchResults) .animation(.snappy, value: searchResults)
} else { } else {
List(searchResults, id: \.self) { item in List(searchResults, id: \.self) { item in
StickerRow(hoarder: hoarder, sticker: hoarder.trie.dict[item]!) StickerRow(hoarder: hoarder, emoji: hoarder.trie.dict[item]!)
} }
.animation(.snappy, value: searchResults) .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 {
StickerRow(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")
// }
//}
-103
View File
@@ -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")
// }
//}
+1 -2
View File
@@ -24,8 +24,7 @@
{ {
"name" : "PerformanceTests", "name" : "PerformanceTests",
"testFunctions" : [ "testFunctions" : [
"downloadAll()", "downloadAll()"
"fakeDownloadAllStickers()"
] ]
} }
] ]
+48 -57
View File
@@ -14,21 +14,27 @@ struct StickerSlackTests {
@Test func MSStickerValidation() async throws { @Test func MSStickerValidation() async throws {
let goodEmoji = Emoji( let goodEmoji = Emoji(
name: "name", name: "name",
url: URL(string: "https://neon443.xyz/images/fav.ico")!, url: URL(string: "https://neon443.github.io/images/fav.ico")!,
id: "0c48f4c3-1c63-41ed-96db-909e50e35dfc" id: UUID(uuidString: "0c48f4c3-1c63-41ed-96db-909e50e35dfc")!
) )
try! await goodEmoji.downloadImage() try! await goodEmoji.downloadImage()
#expect(goodEmoji.msSticker!.validate(), "should be true") #expect(goodEmoji.sticker!.validate(), "should be true")
let badEmoji = Emoji( let badEmoji = Emoji(
name: "160chars:shttps://emoji.slack-edge.com/T0266FRGM/100906/ddeb22d813b83b0f.pngs,sexpirationfds2025-10-28T08:00:02.011Zs},{gtypeh:jemojieeeidggg9cab2003-ad74-492a-", 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")!, 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() try! await badEmoji.downloadImage()
#expect(goodEmoji.msSticker!.validate(), "should be true") #expect(goodEmoji.sticker!.validate(), "should be true")
badEmoji.deleteImage() badEmoji.deleteImage()
} }
@Test func deleteAllEmojis() async throws {
let performanceTests = PerformanceTests(hoarder: .shared)
try! await performanceTests.fakeDownloadAllStickers()
await hoarder.deleteAllStickers()
}
} }
struct PerformanceTests { struct PerformanceTests {
@@ -37,7 +43,7 @@ struct PerformanceTests {
@Test func stickerConversion() async throws { @Test func stickerConversion() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions. // Write your test here and use APIs like `#expect(...)` to check expected conditions.
for emoji in hoarder.emojis { 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 { @Test func downloadAll() async throws {
let downloadedEmojisBefore = hoarder.emojis.filter { $0.isLocal }.map { $0.id } 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 { func doThing(on emoji: Emoji, i: inout Int) async throws {
do { do {
guard !emoji.isLocal else { return } guard !emoji.isLocal else { return }
async let (data, _) = try URLSession.shared.data(from: emoji.remoteImageURL) async let (data, _) = try URLSession.shared.data(from: emoji.remoteImageURL)
try! await data.write(to: emoji.localImageURL) try! await data.write(to: emoji.localImageURL)
let _ = emoji.msSticker?.validate() let _ = emoji.sticker?.validate()
i+=1 i+=1
print("\(i)/\(hoarder.emojis.count) \(emoji.name)") print("\(i)/\(hoarder.emojis.count) \(emoji.name)")
} catch { } catch {
@@ -99,66 +113,43 @@ struct PerformanceTests {
} }
} }
// @Test func fakeDownloadAllStickers() async throws { @Test func fakeDownloadAllStickers() async throws {
// await withDiscardingTaskGroup { group in await withDiscardingTaskGroup { group in
// for emoji in hoarder.emojis { for emoji in hoarder.emojis {
// group.addTask { group.addTask {
// try! Data().write(to: emoji.localImageURL) try! Data().write(to: emoji.localImageURL)
// } }
// } }
// } }
// } }
@Test func deleteAllImages() async throws { @Test func deleteAllImages() async throws {
// try! await fakeDownloadAllStickers() try! await fakeDownloadAllStickers()
await hoarder.deleteAllStickers() await hoarder.deleteAllStickers()
} }
@Test func buildTrie() async throws { @Test func buildTrie() async throws {
hoarder.resetAllIndexes() hoarder.resetTrie()
hoarder.buildTrie() 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 { @Test func testDownloadedEmojis() async throws {
for emoji in hoarder.emojis { for emoji in hoarder.emojis {
let x = hoarder.downloadedStickers.contains(emoji.name) 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)
}
}
}
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 UIKit
import Messages import Messages
import SwiftUI
class MessagesViewController: MSMessagesAppViewController { class MessagesViewController: MSMessagesAppViewController {
let dataSource: StickerBrowserDataSource = StickerBrowserDataSource() 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.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height)
stickerBrowser.dataSource = dataSource stickerBrowser.dataSource = dataSource
stickerBrowser.autoresizingMask = [.flexibleWidth] 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) view.addSubview(stickerBrowser)
stickerBrowser.reloadData() stickerBrowser.reloadData()
view.bringSubviewToFront(stickerBrowser) view.bringSubviewToFront(stickerBrowser)
@@ -105,12 +73,4 @@ class MessagesViewController: MSMessagesAppViewController {
// Use this method to finalize any behaviors associated with the change in presentation style. // 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 { class StickerBrowserDataSource: NSObject, MSStickerBrowserViewDataSource {
var hoarder: EmojiHoarder = EmojiHoarder(localOnly: true, skipIndex: true) var hoarder: EmojiHoarder = EmojiHoarder(localOnly: true, skipIndex: true)
var msStickers: [MSSticker] = [] var emojis: [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")
}
func numberOfStickers(in stickerBrowserView: MSStickerBrowserView) -> Int { func numberOfStickers(in stickerBrowserView: MSStickerBrowserView) -> Int {
print(msStickers.count, "numberofstickers") guard emojis.isEmpty else { return emojis.count }
return msStickers.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 { func stickerBrowserView(_ stickerBrowserView: MSStickerBrowserView, stickerAt index: Int) -> MSSticker {
return msStickers[index] return emojis[index]
} }
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.