I'm not sure what to do here, previous errors told me to make this struct encodable but I'm not sure how exactly how to do it? ChatMessage works but ImageMessage does not. The specific error is Type 'ImageMessage' does not conform to protocol 'Encodable'
import Foundation
import FirebaseFirestoreSwift
import UIKit
struct ChatMessage: Codable, Identifiable {
@DocumentID var id: String?
let fromId, toId, text: String
let timestamp: Date
}
struct ImageMessage: Encodable, Identifiable {
@DocumentID var id: String?
let fromId, toId: String
let image: UIImage
let timestamp: Date
}```