added Emoji.isLocal to check if the emoji is stored

This commit is contained in:
neon443
2025-10-23 21:12:08 +02:00
parent 4ed5695f4a
commit bc0b46a6df
3 changed files with 23 additions and 6 deletions

View File

@@ -23,6 +23,7 @@
A969D6AE2EA3F1AF00399C05 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A969D6A92EA3F1AF00399C05 /* MainInterface.storyboard */; }; A969D6AE2EA3F1AF00399C05 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A969D6A92EA3F1AF00399C05 /* MainInterface.storyboard */; };
A969D6AF2EA3F1AF00399C05 /* MessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A969D6AA2EA3F1AF00399C05 /* MessagesViewController.swift */; }; A969D6AF2EA3F1AF00399C05 /* MessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A969D6AA2EA3F1AF00399C05 /* MessagesViewController.swift */; };
A9773C2F2EA54AF000F3B753 /* EmojiPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */; }; A9773C2F2EA54AF000F3B753 /* EmojiPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9773C2E2EA54AF000F3B753 /* EmojiPreview.swift */; };
A986A6682EAAB41000B6E0FA /* Haptics in Frameworks */ = {isa = PBXBuildFile; productRef = A986A6672EAAB41000B6E0FA /* Haptics */; };
A9BE06DB2EA656B80033B213 /* EmojiHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A949B1F72EA04F2300215164 /* EmojiHoarder.swift */; }; A9BE06DB2EA656B80033B213 /* EmojiHoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A949B1F72EA04F2300215164 /* EmojiHoarder.swift */; };
A9BE06DC2EA657C70033B213 /* ApiEmoji.swift in Sources */ = {isa = PBXBuildFile; fileRef = A940FE3C2EA232590016870B /* ApiEmoji.swift */; }; A9BE06DC2EA657C70033B213 /* ApiEmoji.swift in Sources */ = {isa = PBXBuildFile; fileRef = A940FE3C2EA232590016870B /* ApiEmoji.swift */; };
A9BE06DD2EA657CF0033B213 /* SlackResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A949B1FA2EA0518800215164 /* SlackResponse.swift */; }; A9BE06DD2EA657CF0033B213 /* SlackResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A949B1FA2EA0518800215164 /* SlackResponse.swift */; };
@@ -79,6 +80,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A924C3782EA9225800F20781 /* Haptics in Frameworks */, A924C3782EA9225800F20781 /* Haptics in Frameworks */,
A986A6682EAAB41000B6E0FA /* Haptics in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -193,6 +195,7 @@
name = StickerSlack; name = StickerSlack;
packageProductDependencies = ( packageProductDependencies = (
A924C3772EA9225800F20781 /* Haptics */, A924C3772EA9225800F20781 /* Haptics */,
A986A6672EAAB41000B6E0FA /* Haptics */,
); );
productName = StickerSlack; productName = StickerSlack;
productReference = A949B1DF2EA04C0B00215164 /* StickerSlack.app */; productReference = A949B1DF2EA04C0B00215164 /* StickerSlack.app */;
@@ -245,7 +248,7 @@
mainGroup = A949B1D62EA04C0B00215164; mainGroup = A949B1D62EA04C0B00215164;
minimizedProjectReferenceProxies = 1; minimizedProjectReferenceProxies = 1;
packageReferences = ( packageReferences = (
A924C3762EA9225800F20781 /* XCLocalSwiftPackageReference "../Haptics" */, A986A6662EAAB41000B6E0FA /* XCRemoteSwiftPackageReference "Haptics" */,
); );
preferredProjectObjectVersion = 77; preferredProjectObjectVersion = 77;
productRefGroup = A949B1E02EA04C0B00215164 /* Products */; productRefGroup = A949B1E02EA04C0B00215164 /* Products */;
@@ -631,18 +634,27 @@
}; };
/* End XCConfigurationList section */ /* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */ /* Begin XCRemoteSwiftPackageReference section */
A924C3762EA9225800F20781 /* XCLocalSwiftPackageReference "../Haptics" */ = { A986A6662EAAB41000B6E0FA /* XCRemoteSwiftPackageReference "Haptics" */ = {
isa = XCLocalSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
relativePath = ../Haptics; repositoryURL = "http://github.com/neon443/Haptics";
requirement = {
branch = main;
kind = branch;
}; };
/* End XCLocalSwiftPackageReference section */ };
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */ /* Begin XCSwiftPackageProductDependency section */
A924C3772EA9225800F20781 /* Haptics */ = { A924C3772EA9225800F20781 /* Haptics */ = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
productName = Haptics; productName = Haptics;
}; };
A986A6672EAAB41000B6E0FA /* Haptics */ = {
isa = XCSwiftPackageProductDependency;
package = A986A6662EAAB41000B6E0FA /* XCRemoteSwiftPackageReference "Haptics" */;
productName = Haptics;
};
/* End XCSwiftPackageProductDependency section */ /* End XCSwiftPackageProductDependency section */
}; };
rootObject = A949B1D72EA04C0B00215164 /* Project object */; rootObject = A949B1D72EA04C0B00215164 /* Project object */;

View File

@@ -15,6 +15,10 @@ struct Emoji: Codable, Identifiable, Hashable {
var localImageURL: URL var localImageURL: URL
var remoteImageURL: URL var remoteImageURL: URL
var isLocal: Bool {
return (try? Data(contentsOf: localImageURL)) != nil
}
var image: UIImage? var image: UIImage?
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {

View File

@@ -28,6 +28,7 @@ struct ContentView: View {
} }
.buttonStyle(.plain) .buttonStyle(.plain)
} }
.border(emoji.isLocal ? .red : .clear)
} }
} }
.tabItem { .tabItem {