Swift convert NSError to String
error.localizedDescription
doesn't always contain all the information you need. In that instance you do have the option of converting the whole object to a string...
let description = "\(error)"
If your error is of type NSError
, you can use error.localizedDescription
to get the string.