Parse JSON using Swift / SwiftyJSON

前端 未结 2 1332
清歌不尽
清歌不尽 2021-01-28 08:11

I\'ve followed several tutorials on this, and as far as I can tell what I\'m doing should be working. I have the following json response from an api call

{
             


        
2条回答
  •  清歌不尽
    2021-01-28 08:50

    I think you want something like this:

    ApiConnector.sharedInstance.login(emailText.text!, password: passwordText.text!) { (res) in
        if let id = res["Id"].string {
          // Do something.
        }
    }
    

提交回复
热议问题