mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
minor changes; working on gphy
This commit is contained in:
4 files changed
+8
-9
No files matched your search
+1
-1
@@ -5,7 +5,7 @@
|
||||
// Created by neon443 on 02/11/2025.
|
||||
//
|
||||
|
||||
VERSION = 1.0
|
||||
VERSION = 2.0
|
||||
BUILD = 1
|
||||
|
||||
// Configuration settings file format documentation can be found at:
|
||||
|
||||
@@ -13,8 +13,8 @@ import Combine
|
||||
class GifHoarder: Hoarder, ObservableObject {
|
||||
static let container: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
||||
|
||||
var endpoint: URL = URL(string: "api.giphy.com/v1/gifs/trending")!
|
||||
var endpointSearch: URL = URL(string: "api.giphy.com/v1/gifs/search")!
|
||||
var endpoint: URL = URL(string: "https://api.giphy.com/v1/gifs/trending")!
|
||||
var endpointSearch: URL = URL(string: "https://api.giphy.com/v1/gifs/search")!
|
||||
|
||||
@Published var searchTerm: String = ""
|
||||
@Published var trendingGifs: [Gif] = []
|
||||
@@ -35,9 +35,8 @@ class GifHoarder: Hoarder, ObservableObject {
|
||||
Task {
|
||||
do {
|
||||
async let (data, _) = try URLSession.shared.data(from: endpoint)
|
||||
// let decoded: [String: Any] = decoder.decode([String: Any].self, from: await data)
|
||||
dump(await data)
|
||||
print()
|
||||
print(await data.base64EncodedString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import Foundation
|
||||
|
||||
enum StickerType: CustomStringConvertible, CaseIterable, Identifiable {
|
||||
case slackEmoji
|
||||
case giphyGif
|
||||
case giphyGifs
|
||||
|
||||
var id: String { self.description }
|
||||
|
||||
@@ -17,8 +17,8 @@ enum StickerType: CustomStringConvertible, CaseIterable, Identifiable {
|
||||
switch self {
|
||||
case .slackEmoji:
|
||||
return "Slack Emoji"
|
||||
case .giphyGif:
|
||||
return "Giphy GIF"
|
||||
case .giphyGifs:
|
||||
return "Giphy GIFs"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ struct BrowseView: View {
|
||||
ForEach(hoarder.emojis, id: \.self) { emoji in
|
||||
EmojiRow(hoarder: hoarder, emoji: emoji)
|
||||
}
|
||||
case .giphyGif:
|
||||
case .giphyGifs:
|
||||
Text("hi")
|
||||
}
|
||||
}
|
||||
|
||||