how to parse string array with SwiftyJSON?

后端 未结 4 2112
长情又很酷
长情又很酷 2020-12-13 06:29

Using SwiftyJSON how would I parse the following JSON array into a Swift [String]?

{
    \"array\": [\"one\", \"two\", \"three\"]
}         


        
4条回答
  •  一生所求
    2020-12-13 06:53

    Simply do this:

    for stringInArray in json["array"]{
    
        let value = stringInArray.1.stringValue
    }
    

提交回复
热议问题