Does this help…
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
do {
let data = try encoder.encode(user) //convert user to json data here
print(String(data: data, encoding: .utf8)!) //print to console
} catch {
print("fail")
}
Topic:
App & System Services
SubTopic:
General
Tags: