0
I want to display in the console the value of the name variable that appears is "(lldb)", why?
@IBAction func botaoAcesse(_ sender: Any) {
let cpf = self.campoCPF.text
let senha = self.campoSenha.text
let param = ["cpf": cpf, "senha": senha, "method": "app-get-login", "plataforma":"ios"]
var _: HTTPHeaders = ["Content-Type": "application/json"]
let url = "http://easypasse.com.br/gestao/wsLogin.php"
Alamofire.request(url, method:.post, parameters:param,encoding: JSONEncoding.default).responseJSON { response in
switch response.result {
case .success:
print(response)
if let JSON = response.result.value as? [String: Any] {
let registro = JSON["registro"] as? String
let usuario = JSON["usuario"] as? String
let nome = JSON["nome"] as? String
print(nome!)
}
case .failure(let error):
print(0,"Error")
}
}
}
But this is a json object, inside another.
– GustavoSevero
And someone else did it.
– GustavoSevero
JSON is correct! Veja https://stackoverflow.com/questions/51270389/why-cant-i-show-data-in-print .
– GustavoSevero