xuyecan

Results comments of xuyecan

能给个实际例子吗?给出类定义、JSON串。

Any class/struct conform to protocol 'HandyJSON' need an empty initializer. Struct has a default one but when you declare other it'll be overrid, which make the struct do not conform...

I'll specify it in the readme later.

Thank you for your encouragement. ^^

Thanks for your advice. I have added the guide in [#dede807](https://github.com/alibaba/HandyJSON/commit/dede807d6182a7a5a5e83b1626b43e90f0e5adbd).

1. 这个功能已经在开发中了,下个版本就会支持; 2. `JSONDeserializer.deserializeFrom(json: )` 方法,做的第一件事情便是:根据`T`类型来生成一个初始实例,这个过程便是调用了 `let instance = T.init()`。Swift中,`class`类型默认实现了空的`init()`构造函数,但一旦你为它指定了别的构造函数,这个空的就会被覆盖。所以协议中就要求必须显式实现一个空的,以便 `let instance = T.init()` 能够成功执行。

还是需要的,因为要拿到子model的实例,仍然需要子model指定一个构造函数。

1. 对于`deserializeFrom()`接口,目前确实只接受 string类型的json串 和 NSDictionary,后续会增加对 Swift的Dictionary的支持。 2. 如果是Model类里的属性类型,那 NSDictionary、NSArray、Dictionary、Array 都是支持的呀。

此外,Array -> Model,感觉没有这种场景吧,还是你说的是 Array -> Array呢?一个数组没办法映射到一个Model上的,因为Model对应的是KV结构的collection。