How to access nested JSON in brackets in Swift?

前端 未结 2 1999
無奈伤痛
無奈伤痛 2021-01-26 04:52

I have a JSON response which is in brackets and I struggle to access the inner fields e.g. display_name with Swift. How can I do that?

Optional([\"result\": {
us         


        
2条回答
  •  花落未央
    2021-01-26 05:38

    In response result is dictionary not array, try to get like this

    let result = response!["result"]  as? [String:AnyObject]
    

提交回复
热议问题