//
//  SHRecordFolderModel.swift
//  ShorthandMaster
//
//  Created by 明津李 on 2020/9/23.
//  Copyright © 2020 明津李. All rights reserved.
//

import UIKit

class SHRecordFolderModel: NSObject{

    @objc var name: String = ""
    @objc var id: String = ""
    @objc var createDate: Date = Date()
    @objc var modifyDate: Date = Date()
    
    @objc var top: Bool = false
    
    @objc var dataSources: Array<SHRecordModel> = []
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
    }
    
//    //构造方法
//    required init(createDate:Date=Date(), modifyDate:Date=Date(), name:String="", id:String="", top:Bool=false, dataSources:Array<SHRecordModel> = []) {
//        self.name = name
//        self.id = name
//        self.createDate = createDate
//        self.modifyDate = modifyDate
//        self.top = top
//        self.dataSources = dataSources
//    }
//
//    //从object解析回来
//    required init(coder decoder: NSCoder) {
//        self.createDate = (decoder.decodeObject(forKey: "createDate") as? Date)!
//        self.modifyDate = (decoder.decodeObject(forKey: "modifyDate") as? Date)!
//        self.id = decoder.decodeObject(forKey: "id") as? String ?? ""
//        self.name = decoder.decodeObject(forKey: "name") as? String ?? ""
//        self.top = decoder.decodeObject(forKey: "top") as? Bool ?? false
//        self.dataSources = decoder.decodeObject(forKey: "dataSources") as! Array<SHRecordModel>
//    }
//
//    //编码成object
//    func encode(with coder: NSCoder) {
//        coder.encode(createDate, forKey:"createDate")
//        coder.encode(modifyDate, forKey:"modifyDate")
//        coder.encode(top, forKey:"top")
//        coder.encode(name, forKey:"name")
//        coder.encode(id, forKey:"id")
//        coder.encode(dataSources, forKey:"dataSources")
//    }
}
