I am a newbie to iOS and I am using alamofire. When i call the API the result is successfully getting printed to console as shown
What I want is, to only extract the message from this response and present it to user. How to do it?
I have searched for this but I found content related to converting string to JSON object or JSON object to JSON string. But my response is of type
DataResponse<Any>
You can try something like this:
if let object = response.result.value as? [String:Any], let message = object["message"] as? String {
print(message) // "User has been successfully registrered"
}