AndroMasta AndroMasta - 27 days ago 15
Swift Question

Swift 3 json parsing library suggestion

I'd like to parse some JSON data with swift but its very difficult for me to do because of optionals. How to do this?

I tried using Standard libraries to do this

Answer

Try to use SwiftyJSON library

https://github.com/SwiftyJSON/SwiftyJSON

With SwiftyJSON all you have to do is:

let json = JSON(data: dataFromNetworking) if let userName = json[0]["user"]["name"].string { //Now you got your value }