mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-03-11 13:26:17 +00:00
95% faster local image url getting
added localImageURL() test
This commit is contained in:
@@ -564,7 +564,7 @@
|
|||||||
A949B1EB2EA04C0C00215164 /* Debug */ = {
|
A949B1EB2EA04C0C00215164 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = StickerSlack;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_ENTITLEMENTS = StickerSlack/StickerSlack.entitlements;
|
CODE_SIGN_ENTITLEMENTS = StickerSlack/StickerSlack.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
@@ -609,7 +609,7 @@
|
|||||||
A949B1EC2EA04C0C00215164 /* Release */ = {
|
A949B1EC2EA04C0C00215164 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = StickerSlack;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_ENTITLEMENTS = StickerSlack/StickerSlack.entitlements;
|
CODE_SIGN_ENTITLEMENTS = StickerSlack/StickerSlack.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ struct Emoji: Codable, Identifiable, Hashable {
|
|||||||
let urlString = remoteImageURL.absoluteString
|
let urlString = remoteImageURL.absoluteString
|
||||||
let split = urlString.split(separator: ".")
|
let split = urlString.split(separator: ".")
|
||||||
let fileExtension = ".\(split.last ?? "png")"
|
let fileExtension = ".\(split.last ?? "png")"
|
||||||
return EmojiHoarder.container.appendingPathComponent(id.uuidString+fileExtension, conformingTo: .image)
|
// return EmojiHoarder.container.appendingPathComponent(id.uuidString+fileExtension, conformingTo: .image)
|
||||||
|
return URL(string: EmojiHoarder.container.absoluteString+id.uuidString+fileExtension)!
|
||||||
}
|
}
|
||||||
var remoteImageURL: URL
|
var remoteImageURL: URL
|
||||||
|
|
||||||
|
|||||||
@@ -10,11 +10,17 @@ import Testing
|
|||||||
struct StickerSlackTests {
|
struct StickerSlackTests {
|
||||||
var hoarder = EmojiHoarder()
|
var hoarder = EmojiHoarder()
|
||||||
|
|
||||||
@Test func example() 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 {
|
||||||
print(emoji.sticker)
|
print(emoji.sticker)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test func localImageURL() async throws {
|
||||||
|
for emoji in hoarder.emojis {
|
||||||
|
print(emoji.localImageURL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user