Debugging

    [iOS] PrettyPrintJson, Print Log Debugging 을 편하게 하자

    URLSession을 사용할때 JSON데이터를 print하면 Postman에서의 출력과는 다르게 한줄로 보기 힘들게 출력됩니다 extension Data { var prettyJson: String? { guard let object = try? JSONSerialization.jsonObject(with: self, options: []), let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]), let prettyPrintedString = String(data: data, encoding:.utf8) else { return nil } return prettyPrintedString } } 다음..