我有JSON。如何获取student_id,first_name和second_name?

时间:2018-07-02 05:38:47

标签: swift3

这是我从URL解析的JSON。现在,我需要此JSON中的student_idfirst_namesecond_name。我该怎么办?

[{
    "timestamp": "2017-06-29 05:37:23",
    "student_id": "6",
    "first_name": "SACHIN",
    "second_name": "SINGH",
    "sex": "male",
    "student_course": "TECH-NON-TECH",
    "email_id": "sachinsinghchahar9058841073@gmail.com",
    "password": "kbmss@10002",
    "phone": "8879505608",
    "login_id": "kbmss",
    "status": "2",
    "roll_no": "",
    "payment": "cash",
    "amount_description": "cash",
    "amount": "8500",
    "refrence_id": "",
    "child_id": "0",
    "plan": "advance",
    "valid_upto": "2017-12-14"
}]

1 个答案:

答案 0 :(得分:0)

switch response.result{
    case .success(let data) :
    let json = JSON(data)

有关更多说明,您可以转到此链接。

  

How to get values of an array of dictionary from alamofire response using swift3