Remade project structure
This commit is contained in:
24
GIFCollectorIM/Models/GIF.swift
Normal file
24
GIFCollectorIM/Models/GIF.swift
Normal file
@@ -0,0 +1,24 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
struct GIF: Codable, Identifiable, Equatable {
|
||||
let id: UUID
|
||||
let localFilePath: String
|
||||
let createdAt: Date
|
||||
let originalURL: String
|
||||
|
||||
var fileURL: URL? {
|
||||
return URL(fileURLWithPath: localFilePath)
|
||||
}
|
||||
|
||||
init(localFilePath: String, originalURL: String) {
|
||||
self.id = UUID()
|
||||
self.localFilePath = localFilePath
|
||||
self.originalURL = originalURL
|
||||
self.createdAt = Date()
|
||||
}
|
||||
|
||||
static func == (lhs: GIF, rhs: GIF) -> Bool {
|
||||
return lhs.id == rhs.id
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user