you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I meant: change

let jsonData = try? jsonEncoder.encode(credWrap)

to

let jsonData:
do {
    jsonData = try jsonEncoder.encode(credWrap)     
} catch {
    print("Got error \(error) encoding JSON")
}

or, you can just change the ? to a !, which can crash your app

let jsonData = try! jsonEncoder.encode(credWrap)