Cannot store custom class in UserDefaults - Attempt to insert non-property list
问题 I'm trying to store a custom class in UserDefaults , however I'm getting the "Attempt to insert non-property list" error as soon as the app starts. I have successfully stored arrays of custom classes, so I followed the same principle, but something is wrong. This is my class: import Foundation public class PlanRouteFilters: NSObject, NSCoding, Codable { var favoriteLines: Bool var routeType: Int var bus: Bool var train: Bool var subway: Bool var electric: Bool var sharedCar: Bool var bike: