init, finished
This commit is contained in:
22
GIFCollector MessagesExtension/Models/GIF.swift
Normal file
22
GIFCollector MessagesExtension/Models/GIF.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
struct GIF: Codable, Identifiable, Equatable {
|
||||
let id: UUID
|
||||
let urlString: String
|
||||
let createdAt: Date
|
||||
|
||||
var url: URL? {
|
||||
return URL(string: urlString)
|
||||
}
|
||||
|
||||
init(urlString: String) {
|
||||
self.id = UUID()
|
||||
self.urlString = urlString
|
||||
self.createdAt = Date()
|
||||
}
|
||||
|
||||
static func == (lhs: GIF, rhs: GIF) -> Bool {
|
||||
return lhs.id == rhs.id
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user