How to use SwiftyJSON on nested JSON values

后端 未结 1 902
日久生厌
日久生厌 2021-01-18 18:47

I\'m calling a JSON API that has several nested values that I need to get. I\'m using SwiftyJSON to make things a little cleaner. For the top level values, everything seems

相关标签:
1条回答
  • 2021-01-18 19:24

    Try

    var profileImage: String! = userDict["userImages"]["profile"][0]["filename"].string
    
    var characterName: String! = userDict["characters"][0]["characterName"].string
    

    and let us know what it gives.

    0 讨论(0)
提交回复
热议问题