     }
     
     private enum Case:String {
-        case Struct = "struct"
+        case CustomType = "type"
         case Dict = "dict"
         case Array = "array"
         case Str = "string"

            return ((int as! Int), Int.self)
        case .FloatingPoint(let float):
            return (float as! Float, Float.self)
        case .Struct(let typeName, let data):
            //log("desrialize struct")
            let names = SuperSerial.serializableTypes.map({ $0.ss_typeName })
            if let index = names.indexOf("\(typeName).Type") {
                //log("found name")
                let type:Serializable.Type = SuperSerial.serializableTypes[index]
//                var newData = [String:Serializable]()
                //log("initing with data:\(data) --- : \(type.init(fromSerialized: data))")
                //log("=================")
                let initd = type.init(fromSerialized: data)
                //log("=================")

                //log("initd: \(initd)")
                return (initd!, type)
            }
            return nil

        }
        return Serialized.Str("")
    }
}

public protocol SerializableObject: NSObjectProtocol, AutoSerializable {
    static var serializableKeys:[String] { get }
    
    func valueForKey(key:String) -> AnyObject
    func setValue(value: AnyObject?, forKey key: String)
}

public extension SerializableObject {
    public func ss_serialize() -> Serialized {
        var dict = [String:Serialized]()
        
        for key in self.dynamicType.serializableKeys {
            dict[key] = (self.valueForKey(key) as? Serializable)?.ss_serialize()
        }
        return Serialized.CustomType(typeName: self.dynamicType.ss_typeName, data: Serialized.Dict(dict))
    }
}
