SwiftyJSONSwift 的 JSON 开发包
SwiftyJSON 可以让你在 Swift 语言中更好的处理 JSON 数据。
示例代码:
let jsonObject : AnyObject! = NSJSONSerialization.JSONObjectWithData(dataFromTwitter, options: NSJSONReadingOptions.MutableContainers, error: nil)
if let statusesArray = jsonObject as? NSArray{
    if let aStatus = statusesArray[0] as? NSDictionary{
        if let user = aStatus["user"] as? NSDictionary{
            if let userName = user["name"] as? NSDictionary{
                //Finally We Got The Name
            }
        }
    }
}评论
