My structure does not conform to protocol 'Decodable' / 'Encodable'
问题 I was trying to use Codable to save my data from the app I am creating but when I put Codable into my structure I keep getting the error: Type 'ReminderGroups' does not conform to protocol 'Decodable' and Type 'ReminderGroups' does not conform to protocol 'Encodable' struct ReminderGroups: Codable { var contentsArray: [ReminderItem] = [] var reminderName: String = "" var reminderItem: UIImage = #imageLiteral(resourceName: "Folder") } 回答1: In order for a class or a struct to conform to a