mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
28 lines
571 B
Swift
28 lines
571 B
Swift
//
|
|
// Asset.swift
|
|
// lottie-swift
|
|
//
|
|
// Created by Brandon Withrow on 1/9/19.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public class Asset: Codable {
|
|
|
|
/// The ID of the asset
|
|
public let id: String
|
|
|
|
private enum CodingKeys : String, CodingKey {
|
|
case id = "id"
|
|
}
|
|
|
|
required public init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: Asset.CodingKeys.self)
|
|
if let id = try? container.decode(String.self, forKey: .id) {
|
|
self.id = id
|
|
} else {
|
|
self.id = String(try container.decode(Int.self, forKey: .id))
|
|
}
|
|
}
|
|
}
|