I want to make one function in my swift project that converts String to Dictionary json format but I got one error:
Cannot convert expression\'s type
Swift 3:
if let data = text.data(using: String.Encoding.utf8) { do { let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String:Any] print(json) } catch { print("Something went wrong") } }