mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
44 lines
887 B
Swift
44 lines
887 B
Swift
//
|
|
// Emoji.swift
|
|
// StickerSlack
|
|
//
|
|
// Created by neon443 on 17/10/2025.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
import SwiftUI
|
|
import Messages
|
|
import UniformTypeIdentifiers
|
|
|
|
@MainActor
|
|
struct Emoji: StickerProtocol {
|
|
var id: String
|
|
var name: String
|
|
var typeGlyph: String = "slack.logo"
|
|
var remoteImageURL: URL
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case id = "id"
|
|
case name = "name"
|
|
case remoteImageURL = "imageUrl"
|
|
}
|
|
|
|
init(from decoder: any Decoder) throws {
|
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
self.id = try container.decode(String.self, forKey: .id)
|
|
self.name = try container.decode(String.self, forKey: .name)
|
|
self.remoteImageURL = try container.decode(URL.self, forKey: .remoteImageURL)
|
|
}
|
|
|
|
init(
|
|
name: String,
|
|
url: URL,
|
|
id: String = UUID().uuidString
|
|
) {
|
|
self.id = id
|
|
self.name = name
|
|
self.remoteImageURL = url
|
|
}
|
|
}
|