Steve DeRienzo
Steve DeRienzo

Reputation: 237

Using SwiftyJSON wrong?

I am trying to use swiftyJSON for JSON that is stored in a parse column...

I can print out the JSON I'm trying to access..but none of my "if let" statements are printing anything to the logs...hopefully you can help thanks!

enter image description here

enter image description here <----This is the JSON...

this is what I've tried so far..enter image description here

Upvotes: 0

Views: 40

Answers (1)

rshev
rshev

Reputation: 4186

As I can see from your model, you have an array of such entries. You need to enumerate this array before getting string values from there. This code works:

    for (_, entry) in thisJSON {
        if let success = entry["freeChlorine"].string {
            println(success)
        }
    }

Upvotes: 1

Related Questions