sunshinejr / SwiftyUserDefaults

Modern Swift API for NSUserDefaults
http://radex.io/swift/nsuserdefaults/static
MIT License
4.85k stars 366 forks source link

Need a little Help #167

Closed chaseclarkdev closed 5 years ago

chaseclarkdev commented 5 years ago

trying to save data from my app with swiftyUserDefults but somthings not working, i am saving an array of a custom type and its saving the type but not the fields in the type here is the code:

What am i doing wrong??

final class Reminder: NSObject, NSCoding, DefaultsSerializable  {
    func encode(with aCoder: NSCoder) {

    }

    init?(coder aDecoder: NSCoder) {

    }

    //MARK: Content
    var title: String?
    var details: String?

    //MARK: Alerts
    var date: Date?
    var location: CLLocationCoordinate2D?
    var locationTitle: String?
    var isArriving: Bool?
    var isRepeating: Bool?

    //MARK: Other
    var priority: Int?
    var creationDate: Date?

    init(creationDate: Date?) {
        self.creationDate = creationDate

    }

}

extension DefaultsKeys {
    static let AllReminders = DefaultsKey<[Reminder]>("AllReminders", defaultValue: [])
}