Closed marcuswu0814 closed 4 years ago
True, something must of gotten change in a refactor. Feel free to update with a PR!
Just forgot to run test, I will fix it ASAP. 😃
Whoops sorry, I thought this was an issue as I viewed it through the new github notification interface. This is already a PR! :)
I have no idea why the compiler say it must be unwrapped when try to build test specs. 😅
I think it's because of the double optional, though not sure of the specifics. Try a 2 step process
...
let jsonValue = try? JSONSerialization.jsonObject(with: jsonData),
let jsonDictionary = jsonValue as? [String: Any] else {
...
I try to change the guard condition to:
let jsonDictionary = (try? JSONSerialization.jsonObject(with: jsonData)) as? [String: Any]
the error gone, any suggestion to update the template?
Yep, the parenthesis will work too
Which one did you prefer? I can fix that.
I don't mind, I'll let you choose :)