The right method is:
do {
let json = try JSONSerialization.jsonObject(with: data!, options: []) as? [String : Any]
} catch {
print("errorMsg")
}
Thanks to Eric Aya
The right method is:
do {
let json = try JSONSerialization.jsonObject(with: data!, options: []) as? [String : Any]
} catch {
print("errorMsg")
}
Thanks to Eric Aya