How to convert a JSON string to a dictionary?

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 (@lvalue NSData,options:IntegerLitralConvertible … This is my code: func convertStringToDictionary (text:String) -> Dictionary<String,String> { var data :NSData = text.dataUsingEncoding(NSUTF8StringEncoding)! var json :Dictionary = NSJSONSerialization.JSONObjectWithData(data, options:0, error: nil) return json } … Read more