 
 
 //得到所有的属性即value
-protocol PropertieValues {
+protocol PropertieValues: MirrorResult {
     /// 得到所有的属性及其对应的value组成dic，注意value不一定全是基础数据类型，可能是其他自定义对象。同时，dic中存储的都是有值的属性，那些没有赋值的属性不会出现在dic中
     ///
     /// - Returns: dic
     func codablePropertieValues() -> [String:AnyObject]
     
     //遍历所有的属性列表，将所有的属性存储到数组中
-    func codableProperties() -> [String]
+    func allProperties() -> [String]
 }
 
 //MARK: - PropertieValues协议
 extension PropertieValues {
-    func getPropertieValuesWithMirror(mir : Mirror) -> [String:AnyObject] {
-        var result: [String:AnyObject] = [:]
-        if let superMirror = mir.superclassMirror {
-            result = getPropertieValuesWithMirror(mir: superMirror)
-        }
-        for case let (label?, value) in (mir.children) {
-            result[label] = unwrap(any: value) as AnyObject?
-        }
-        return result
-    }
-    
+//    func getPropertieValuesWithMirror(mir : Mirror) -> [String:AnyObject] {
+//        var result: [String:AnyObject] = [:]
+//        if let superMirror = mir.superclassMirror {
+//            result = getPropertieValuesWithMirror(mir: superMirror)
+//        }
+//        for case let (label?, value) in (mir.children) {
+//            result[label] = unwrap(any: value) as AnyObject?
+//        }
+//        return result
+//    }
+//    
     
     /// 得到所有的属性及其对应的value组成dic，注意value不一定全是基础数据类型，可能是其他自定义对象。同时，dic中存储的都是有值的属性，那些没有赋值的属性不会出现在dic中
     ///

    
    public required init?(coder aDecoder: NSCoder) {
        super.init()
        let arr = codableProperties()
        for key in arr {
            let object = aDecoder.decodeObject(forKey: key)
            self.setValue(object, forKey: key)

    func codablePropertieValues() -> [String:AnyObject] {
        var codableProperties = [String:AnyObject]()
        let mirror = Mirror(reflecting: self)
//        codableProperties = getPropertieValuesWithMirror(mir: mirror)
        getResultFromMirror(mir: mirror, action: { (label, value) in
            if label != nil {
                codableProperties[label!] = unwrap(any: value) as AnyObject?
            }
        })
        return codableProperties
    }
    
//    //遍历所有的属性列表，将所有的属性存储到数组中
//    func getPropertiesWithMirror(mir : Mirror) -> [String] {
//        var result: [String] = []
//        if let superMirror = mir.superclassMirror {
//            result = getPropertiesWithMirror(mir: superMirror)
//        }
//        for case let (label?, _) in (mir.children) {
//            result.append(label)
//        }
//        return result
//    }
    
    //遍历所有的属性列表，将所有的属性存储到数组中
    func allProperties() -> [String] {
        var allProperties = [String]()
        let mirror = Mirror(reflecting: self)
//        codableProperties = getPropertiesWithMirror(mir: mirror)
        getResultFromMirror(mir: mirror, action: { (label, value) in
            if label != nil {
                allProperties.append(label!)
            }
        })
        return allProperties
    }
    
    
