因为有了 indirect enum , Swift 终于可以直接表示这种递归的数据结构了
支持 string 、 int 、 float 、 boolean 、 nil 、 array 、 dictionary literal ,然后加了个 initializer 来支持从 NSJSONSerialization 的 JSONObjectWithData (_, options:) 返回的 AnyObject 转成我的 JSON 数据结构
代码如下:
支持 string 、 int 、 float 、 boolean 、 nil 、 array 、 dictionary literal ,然后加了个 initializer 来支持从 NSJSONSerialization 的 JSONObjectWithData (_, options:) 返回的 AnyObject 转成我的 JSON 数据结构
代码如下: