I would like to display the content of the error received from my server in my iPad apps using Swift, but I can not display it correctly:
(lldb) po (response.rawString)
"{\"message\":\"Invalid Credentials\"}"
I would like to display only : Invalid Credentials
You could add a custom type for your error and make it conform to
Codable
and then decode value of
response.rawString
usingJSONDecoder