【发布时间】:2018-07-07 19:43:25
【问题描述】:
JSON 响应 转Arr
[{
"total_amt" : -10000,
"tran_type" : "C3",
"pay_type" : "05",
"tran_time" : "20180125 133122",
"point_total" : 0
},
{
"total_amt" : -1004,
"tran_type" : "C5",
"pay_type" : "05",
"tran_time" : "20180124 163602",
"point_total" : 0
}]
======================
我要过滤 tran_type = "C3"
我该怎么办?
"total_amt" : -10000,
"tran_type" : "C3",
"pay_type" : "05",
"tran_time" : "20180125 133122",
"point_total" : 0
【问题讨论】:
-
“我该怎么办?”在顶部找到一个搜索框,然后按照自己的方式进行操作。
-
json.filter { return $0["tran_type"] as? String == "C3" }反正这样的东西不是一个有效的数据结构,你应该用[和}替换{和] -
感谢您的帮助。 :)
标签: json swift swift3 filter alamofire