 
     private class func unwrapCase(type:Serialized.Case, value:AnyObject) -> Serialized {
         switch type {
-        case .Struct:
-            return Unwrapper.unwrapStruct(value as! NSDictionary)
+        case .CustomType:
+            return Unwrapper.unwrapCustomType(value as! NSDictionary)
         default:
             return Unwrapper.unwrap(value)
         }

    
    private func caseAsString() -> String {
        switch self {
        case .Struct: return Case.Struct.rawValue
        case .Dict: return Case.Dict.rawValue
        case .Array: return Case.Array.rawValue
        case .Str: return Case.Str.rawValue


public extension AutoSerializable {
    public init?(fromSerialized: Serialized) {
        switch fromSerialized {
        case .Dict(let dict):
            var newData = [String:Serializable]()
            for (key,value) in dict {
                if let d = value.deserialize() {
                newData[key] = d.0 as? Serializable
                }
            }
            self.init(withValuesForKeys: newData)
            break
        default: return nil
        }
    }
}

