1

I just can't believe How to convert a JSON string to a dictionary? is the best answer I could find.

Isn't it supposed to be something like JSON(jsonString).asDict() or somthing?

I tried using SwiftyJson to ease the pain, but it doesn't seem to provide the functionality?

When I create a jsonObject using Swifty's JSON(jsonString), I can't pass it to a function which expects a dictionary.

Is there a way to convert JSON(jsonString) to Dictionary?

I tried JSON(jsonString).object as! [String:AnyObject] JSON[jsonString].dictionaryValue .. etc

If SwiftyJson doesn't, is there another library that supports it?

Community
  • 1
  • 1
eugene
  • 39,839
  • 68
  • 255
  • 489
  • 1
    Possible duplicate of [How to convert a JSON string to a dictionary?](http://stackoverflow.com/questions/30480672/how-to-convert-a-json-string-to-a-dictionary) – StrawHara Oct 06 '15 at 07:58
  • That's how you do it with the "built-in" Cocoa/Cocoa Touch frameworks. There are a lot of 3rd party frameworks for JSON, such as https://github.com/SwiftyJSON/SwiftyJSON or https://github.com/Hearst-DD/ObjectMapper (just as examples, I don't have experience with either of them). – Martin R Oct 06 '15 at 08:02

0 Answers0